1

I've just finished setting up my Server on Digital Ocean (Ubuntu 12.10 x64) using nginx, but i want a separate MySQL Server to decrease the load to the web server.

The problem is, im unable to connect to my server.

I've tried to setup iptables to open port 3306, I've commented the line bind-address The server works fine locally, tested with wordpress, nginx and phpmyadmin.

I cant connect from anywhere, keep getting ERROR 1130 (HY000): Host '192.XXX.XXX.XXX' is not allowed to connect to this MySQL server.

And yes i reloaded all services all the times...

  • Im so sorry, but im not familiar using MySQL by SSH and i did not understood this command very well... Maybe i could get the info on PhpMyAdmin? Thx! – lucasmx Feb 4 '14 at 3:07
2

An ERROR 1130 MySQL error is a grant issue within MySQL. That you're getting this is good news - your remote host (let's call it R1) is connecting to your MySQL host (My1). My1 is checking against it's GRANT table and sees that you're not allowed to connect to the database you'd like to as the user you're trying from that remote host (R1).

You need to add a new GRANT to allow the connection.

To see existing grants connect to MySQL as root on My1 (mysql -u root -p mysql) and then run:

SELECT host,user FROM user;
  • This is most likely the issue. To put it simple: Most users are added as a local account only, 'user'@'localhost' and they would need to be added via GRANT with the mask 'user'@'192.xxx.xxx.xxx' – David Houde Feb 4 '14 at 3:07
  • On this MySQL server im using the root user to manage my DBs.... should i work with it or create a new user? And if i create a new user shal i include it in some group? – lucasmx Feb 4 '14 at 3:09
  • 1
    To connect to My1 from R1 you're connecting using a username and password (it won't be root... or, at least, I shouldn't be). You need to ssh to My1 login to MySQL (as above) and GRANT that user access from the IP of R1 (see the link in my answer). I can't give you much more without knowing schema, user and IP - which I don't recommend you publicly share. – Rudu Feb 4 '14 at 3:13
  • It is funny, i just created a new user from PhpMyAdmin panel and granted him permissions and now, using this username, the connection works! Thank you very much! – lucasmx Feb 4 '14 at 11:23

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.