1
server OS: Ubuntu 14.04
MYSQL Server version: 5.5.43-0ubuntu

The output of:

select User, host from user 

is:

db    %
db    localhost 

In my /etc/mysql/my.cnf, I made sure that bind-address is set to the real IP address of the server. I can connect to the server from my laptop using sftp and ssh

Yet, it refuses to connect me when I try to connect using mysqlbench error: can't connect to MySQL server on 'xxxxxxx' 10061

I can also access the web server fine from a browser, it displays the default ubuntu page.

What am I missing?

Update:

I was able to connect when I did: bind-addess=0.0.0.0

This obviously creates a security risk, as you can connect from any IP address, but there was an issue with the way Amazon EC2 assigns internal and external IP addresses, so I have to figure out the correct IP address to bind to.

3 Answers 3

0

If you copied and pasted that output from your SELECT statement, you have a typo in 'localhost'. That could be causing your problem.

1
  • No, that was a typo of my own. If I had this wrong, mysql would not allow me in. Jun 9, 2015 at 14:06
0

I have successfully connected to MySQL on Ubuntu 14 when I set the bind-address to the AWS private IP.

1
  • It is less work to use default bind 0.0.0.0, and it does not add much risk, since it is reachable from outside in both cases subject to amazon security zone settings.
    – eckes
    Nov 12, 2017 at 5:36
0

http://dev.mysql.com/doc/refman/5.5/en/can-not-connect-to-server.html

Add bind-address=my_server_ip_address in my.ini (my.cnf) file after [mysqld]

If you have lost the root pwd, there is a workaround using --skip-grant-tables.

1
  • I tried that before asking my question. Please see my question. I believe the problem is with the way Amazon assigns the IP Address. When I switched the bind-address to 0.0.0.0 I was able to connect fine. This is of course a security issue, but I will figure that out separately. Jun 10, 2015 at 22:37

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