Monday, March 8, 2010

if get Error No 1130 while connecting from your client to your mysql server

check whether the mysql user you are using have permission to connect from your current IP / host

to grant access to the USER;

grant all privileges on *.* to 'user'@'%';

'%' - here is indicating, the 'user' are able to connect via any host

to create a mysql user, 

CREATE USER 'user'@'%' IDENTIFIED BY 'pswd123';



SAMPLE: To create User with "Select" access only
Case 1: to create a user "report" that can access the dabatase from any IPRange

> CREATE USER 'report'@'%' IDENTIFIED BY 'p@ssw0rd';
> GRANT select ON *.* to 'report'@'%';

Case 2: to create a user "report" that can access the dabatase from localhost only
> CREATE USER 'report'@'localhost' IDENTIFIED BY 'p@ssw0rd';
> GRANT select ON *.* to 'report'@'localhost';


NOTE: after create the user, don't forget to flush the privileges.

> FLUSH PRIVILEGES;










No comments:

Post a Comment