Jeremy Hicks
Jeremy Hicks

Reputation: 3740

MySQL blocking access to all but a couple of databases only on certain IP address

So, a couple of days ago, our master instance of MySQL started blocking me from accessing all but a couple of databases but only when connecting from a specific IP address. I can connect and see all the databases when connecting from any other IP address and I can connect and see all databases when connecting to a slave instance. Credentials are the same regardless. I've never seen anything like this.

Upvotes: 0

Views: 224

Answers (3)

vsp
vsp

Reputation: 379

Try run this script

GRANT ALL ON . to user@'%' IDENTIFIED BY 'password';

It would allow you to access from any IP Address and any machines and access all databases.

Good Luck :)

Upvotes: 1

mihaisimi
mihaisimi

Reputation: 2029

To gain access to all databases you need to run these commands as a privileged user (eg on the machine itself):

grant all privileges on *.* to YOUR_USER_ID@REMOTE_IP_ADDRESS_YOU_WANT_TO_BE_ALLOWED;
flush privileges;

To get the YOUR_USER_ID@REMOTE_IP_ADDRESS_YOU_WANT_TO_BE_ALLOWED run the select user(); command. This will let you know how you are accessing the database, you can grant privileges accordingly

Upvotes: 2

hsanders
hsanders

Reputation: 1898

I think what you'll want to do to start exploring this problem is:

http://dev.mysql.com/doc/refman/5.0/en/show-grants.html

show grants for 'user'@'host';

Upvotes: 1

Related Questions