Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I've just installed a fresh ubuntu server with mysql (percona 5.5), but it refuses to accept connections from remote hosts

Here is what happens if I try to connect to this server remotely:

mysql -h10.0.0.2 -uroot -pmypassowrd
ERROR 2003 (HY000): Can't connect to MySQL server on '' (111)

telnet 3306
telnet: Unable to connect to remote host: Connection refused

When I checked if mysql listens to remote connections I saw this:

sudo netstat -ntlup | grep mysql
tcp        0      0*               LISTEN      127018/mysqld 

As you can see it says which means "I accept only local connections".

I checked my skip_networking and bind-address variables - everything is turned off:

mysql> show variables like '%skip_networking%';
| Variable_name   | Value |
| skip_networking | OFF   |
1 row in set (0.00 sec)

mysql> show variables like '%bind%';
Empty set (0.00 sec)

I have another server with absolutely the same config and it works great:

sudo netstat -ntlup | grep mysql
tcp        0      0  *               LISTEN      2431/mysqld 

What can be the reason for this? How do I make mysql respond to remote connections?

share|improve this question
Note that the variable bind_address is only available since version 5.6 (, so it will return an empty set in v5.5 even if it is set. – faker Apr 4 '14 at 10:51
Show us your my.cnf settings. – Iain Apr 4 '14 at 11:34

Try to add bind-address = to your [mysqld] section of your my.cnf and restart mysqld.

share|improve this answer

The solution described in the link bellow should solve your problem

share|improve this answer
bml13, quoting a link in support of your answer is excellent practice, but we much prefer people to write the answer out here and add a link, not just put the link and leave it at that. – MadHatter Apr 4 '14 at 11:25

It could be due to the mysql database user table (use mysql; show tables;). If the bind to don't work for you, try to give your user the host '%' in place of 'localhost' in that table.

For example, try creating a user like:

CREATE USER yourusername@'%' IDENTIFIED BY 'yourpassword'

ant try to connect with that user.

share|improve this answer
Connection refused generally means nothing is listening on the relevant IP:port. – Iain Apr 4 '14 at 11:34
True, I've been flashed by 'Can't connect to MySQL server', I don't recall on the telnet. Sorry. – periket2000 Apr 4 '14 at 11:36

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.