sesc360
sesc360

Reputation: 3255

Connection to MySQL Server not working

I want to connect to my SQL Server on my remote server. I have installed MySQL on this server with apt-get and set up all necessary details. On the server everything works fine. When I want to connect with the MySQL Workbench, I cannot connect with any user at all.

I logged into MySQL in Ubuntu and created a new user first:

CREATE USER 'username'@'localhost' IDENTIFIED BY 'password';
GRANT ALL PRIVILEGES ON *.* TO 'username'@'localhost' WITH GRANT OPTION;
CREATE USER 'username'@'%' IDENTIFIED BY 'password';
GRANT ALL PRIVILEGES ON *.* TO 'username'@'%' WITH GRANT OPTION;
FLUSH PRIVILEGES;

I opened the my.cnf file:

port 3306
bind-address 127.0.0.01 (DO I NEED HERE MY REMOTE SERVER IP?)
service mysql restart

My questions would be:

1) why is the host 127.0.0.1 on my remote server?

2) In the workbench connection setup: which hostname is correct? my server IP or 127.0.0.1

3)I get the message: Failed to connect to MySQL. Access denied. So I think the user is the issue?

4) Do I need to change the cnf?

Thank you.

Upvotes: 0

Views: 226

Answers (1)

Leandro Papasidero
Leandro Papasidero

Reputation: 3738

After you create the user and configure the right permission did you

FLUSH PRIVILEGES;

After you change your my.cnf did you restart Mysql?

Stop and Start from XAMPP Panel control

Change

bind address=127.0.0.1

to

bind-address=YOUR-SERVER-IP

Upvotes: 1

Related Questions