Mysql – How to access remote thesql host on Ubuntu inside VMware

MySQLmysql-error-1045Ubuntuvmware

I'm running Ubuntu 10.10 inside VMware fusion on Mac OSX Snow Leopard. Inside ubuntu, I'm attempting to use command-line mysql to connect to a database hosted on a separate web server. For some reason, mysql misinterprets the remote hostname as a local address, and is not able to connect to the database.

Steps: (from ubuntu inside VMware)

mysql -u <my-username> -h mysql-2.sandbox.wrkng.net -p

Enter Password: <my password>

expected: to log into mysql

got:

ERROR 1045 (28000): Access denied for user '<my-username>'@'c-71-233-98-90.hds1.ma.comcast.net' (using password: YES)

Note that the hostname referenced in the error message is different than the one I inputted to the mysql command.

Also, performing the same command from the Mac (host of the VM) terminal successfully connects to the database.

I am not seasoned with VMware or linux, so I may be missing something obvious here — it seems like somewhere along the way either ubuntu or the VM has a networking issue. Note also that accessing the internet via ubuntu inside the VM works fine.

Any help is greatly appreciated. Thanks!

Best Answer

had the same problem, but you just have to set the user you're using to be allowed from any host, easiest done from phpmyadmin under permssions,

oh and you have to tell mysql to allow connections from elsewhere:

edit /etc/mysql/my.cnf

change this line: bind-address = 127.0.0.1 to: #bind-address = 127.0.0.1 then restart mysql:

sudo service mysql restart and it will work.