0

I just enabled remote access on my mysql server. I did this by going to the database 'mysql' , then the user table and changing the Host column to '%' of the appropriate user. After doing this I noticed that I can't access it locally i.e. when I'm logged into the server via the SHELL, I can't login.

Is it not possible to have both local and remote access ?

Ashesh
  • 939
  • 2
  • 11
  • 28

1 Answers1

4

You need to have a separate row in the mysql.user table with a host value of 'localhost', to enable local unix socket type connections.

A value of '%' in the host column is for the TCP protocol.

Details in the documentation here: http://dev.mysql.com/doc/refman/5.5/en/connecting.html

I have three rows for a user in the mysql.user table, with host values of 'localhost' (for unix socket type connections), '127.0.0.1' for access via TCP from the local host, and '%' for TCP access from other hosts.

Note that MySQL identifies a user not just by the "username", but as the combination of "username" and "host". These are considered distinct users, and each of them can have a different password and a different set of privileges.

spencer7593
  • 106,611
  • 15
  • 112
  • 140