Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

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 '192.168.56.1' 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 10.0.2.15 and eth1 192.168.56.21.

I can connect to Apache at 192.168.56.21, and through PhpMyAdmin, everything works as it should. I did edit the /etc/mysql/my.cnf file and commented out the line bind-address = 127.0.0.1 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'.

EDIT: SOLVED!!

share|improve this question
add comment

2 Answers 2

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';
>FLUSH PRIVILEGES;

Have a nice time.

share|improve this answer
1  
Helped a lot! Thanks :) –  kevin Sep 29 '13 at 12:08
add comment
up vote 1 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
add comment

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.