Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

I am trying to access MySQL Database on Linux Guest from Host and I am getting the following error:

ERROR 2003 (HY000): Can't connect to MySQL server on 'REGAN' (111)

I already setup port forward and turned off iptables and I can access mysql from the guest but not from the host. Everything else works..

This is the command I am using

mysql -h REGAN -u user -ppass

1 Answer 1

The answer is in your question: Can't connect to local MySQL server. Your host is looking for a MySQL server running locally, on the host. You will need to instruct it to look on a remote computer, in this case your guest VM, and you will also need to grant the appropriate privileges and configure your server to accept remote connections. There are instructions on the MySQL site which cover the steps.


Refer to the documentation for PHP or whatever application you're running that needs to connect, for the appropriate connection string.

I feel that I did do that? –  SJS Apr 17 '13 at 14:46
You edited your question, so that makes my answer a bit less applicable. Is REGAN resolving on the client computer (your host)? Did you try the IP address of your MySQL server instead of the hostname? –  trpt4him Apr 17 '13 at 15:06

This site is currently not accepting new answers.

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