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
share|improve this question

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.

http://dev.mysql.com/doc/refman/5.0/en/connecting.html

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

share|improve this answer
    
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

Your Answer

 
discard

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.