0

I'm trying to connect to my local MySQL server with MySQL Workbench. When I do so, I get a "Can't connect to MySQL server..." error. I can connect just fine if I SSH into the machine and start up MySQL there, so I know it's not an issue there.

Is there something special I need to do to tell my MySQL server that "outsiders" can connect to it?

3 Answers 3

1

Make sure that

  • mysqld is not running with --skip-networking

  • or --bind-address = 127.0.0.1

Also make sure you have allowed your client end access to port 3306(by default) on the server and it is not firewalled.

There is more information and all you need to know on this page in the MySQL documentation.

2
  • Thanks, Richard. My solution turned out to be something a little different but your answer put me on the right track. Sep 28, 2010 at 13:08
  • Jason: Glad you got sorted. I forgot to mention the user@%. D'oh. Never mind you got there in the end. Sep 29, 2010 at 16:10
1

yes you do - MySQL authentication is done on a username and host basis.

The best bet is to create an admin user that can auth from any host (% wildcard).

http://dev.mysql.com/doc/refman/5.1/en/adding-users.html

1
  • I did that. Apparently something more needs to be done because that didn't take care of it. (I made sure I could log in with my new user locally before trying it remotely.) Sep 28, 2010 at 12:57
0

I found the following in /etc/mysql/my.cnf:

# Instead of skip-networking the default is now to listen only on
# localhost which is more compatible and is not less secure.
bind-address   = 127.0.0.1

To solve my problem, I did two things:

  1. I created a new user: 'admin'@'%'
  2. I commented out the "bind-address" line in my.cnf.

Now it works.

1
  • Note: you must restart MySQL after this in order for the change to take effect. Oct 11, 2010 at 14:36

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .