Klaus Nji
Klaus Nji

Reputation: 18857

Unable to connect to MySQL on Ubuntu from MySQL Workbench on Windows

I have a Linux VM running Ubuntu 14.04 LTS Server. I have installed MySQL 5.6.26 on it and have added a user by issuing the following commands from the terminal window:

CREATE USER 'sas'@'%' IDENTIFIED BY 'some-password-1234';
GRANT ALL PRIVILEGES ON *.* TO 'sas'@'%' IDENTIFIED BY 'some-password-1234' WITH GRANT OPTION;
FLUSH PRIVILEGES;

I can log into mysql with this user with this command:

mysql -u sas -p

and can see this user listed in mysql.users table by issuing this command:

mysql> select host, user from mysql.user;

which results to the following output:

+-----------+------------------+
| host      | user             |
+-----------+------------------+
| %         | sas              |
| 127.0.0.1 | root             |
| ::1       | root             |
| localhost | debian-sys-maint |
| localhost | root             |
| ubuntu    | root             |
+-----------+------------------+

However, when I try to setup a connection in MySQL Workbench from a Windows box using the credentials of user "sas", I get

"Can't connect to MySQLServer on 10.166.7.16".

This is not a network issue since running tcpdump on the Linux box shows the initiated connection from the Windows box.

What should I be looking out for?

Upvotes: 0

Views: 323

Answers (1)

DaSourcerer
DaSourcerer

Reputation: 6606

On Debian and Ubuntu, mysqld binds to the lo interface only by default. Go through MySQL's configs and look for a directive that reads bind-address. Change its value to 0.0.0.0 if necessary, restart mysqld and try again.

Upvotes: 2

Related Questions