Ask Ubuntu is a question and answer site for Ubuntu users and developers. Join them; it only takes a minute:

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 hope this is the right place for this...I currently am running Ubuntu Server 12.04 through VirtualBox on a Windows 7 host. I am trying to connect to the VM's MySQL engine using MyDB Studio for MySQL, and when I enter my MySQL login credentials, it gives me the following error back:

Error 1130: Host '' is not allowed to connect to this MySQL server

I am running the VM with Adapter 1 enabled for NAT, and Adapter 2 enabled for Host-only Adapter. eth0 and eth1

I can connect to Apache at, and through PhpMyAdmin, everything works as it should. I did edit the /etc/mysql/my.cnf file and commented out the line bind-address = by adding a # in front of it - I thought that this should have allowed remote connections.

Any ideas on how I can solve this? What could be wrong?

EDIT: I am trying to connect as 'root'.


share|improve this question

On your server run mysql from command line:

mysql -u root -p -h localhost -P 3306

Then run this command in mysql shell:

>use mysql
>GRANT ALL ON *.* to root@'%' IDENTIFIED BY 'pass';

Have a nice time.

share|improve this answer
Helped a lot! Thanks :) – kevin Sep 29 '13 at 12:08
May i ask you, what is the reason for this problem? – shgnInc Jan 31 '15 at 7:31
up vote 3 down vote accepted

Ok, this was such as silly oversight on my part, but the following 2 links pointed me in the right direction:

So in the spirit of helping someone else out who might have the same problem...

I created a new user, granted him all privileges, and set the host to % to allow connections from any IP. Logged in with the new user, and voila! all good

share|improve this answer

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.