Not allowed to connect to this MySQL server

By | July 2, 2008

When connecting to a remote mysql server, the login/user must have rights to connect to the mysql server from outside of the local server, i.e. localhost. You need to edit the user record within the mysql.user table or add a new record for this user, giving it access to connect to the mysql server from a host other than localhost.

Login to the mysql server add run the following command:
grant all privileges on *.* to 'user'@'' identified by 'password' with GRANT OPTION;
Replace “user” and “password” and “” with your mysql username, password, and the IP address of your computer that you’re connecting (to the mysql server) from.

Remember that your mysql server must also allow connections from remote hosts.

3 thoughts on “Not allowed to connect to this MySQL server

  1. Pingback: Can’t connect to mysql server on remote server | Mac OS X Leopard & Tiger Dual Boot

  2. GiriPrasad

    Dear All,

    Very Much Thank u for posting this Its Working Fine ..
    I visited lot of site but not able to get solution.

    Thanking u once again.


  3. Steph

    Thanks for providing such a useful post. I can now connect to mysql server. I find replacing the username, passowrd, and IP address quite effective.


Leave a Reply

Your email address will not be published. Required fields are marked *