Custom Search

Thursday, June 9, 2011

Can not connect to remote MySQL server Solved

Can not connect to remote MySQL server Solved

------------------------- Error-1
$ mysql -uroot -ppassword --host=192.168.1.108
_mysql_exceptions.OperationalError: (2003, "Can't connect to MySQL server on '192.168.1.108' (111)")

Solution
===========
In /etc/mysql/my.cnf comment fllowing line.
#bind-address = 127.0.0.1


------------------------- Error-2
$ mysql -uroot -ppassword --host=192.168.1.108
_mysql_exceptions.OperationalError: (1130, "Host 'localhost.local' is not allowed to connect to this MySQL server")

Solution
===========
Run following commands in Mysqlserver.

$ mysql -uroot -ppassword


mysql> CREATE USER 'root'@'localhost.local' IDENTIFIED BY "password";
Query OK, 0 rows affected (0.00 sec)


mysql> GRANT ALL PRIVILEGES ON *.* TO 'root'@'localhost.local';
Query OK, 0 rows affected (0.00 sec)

No comments:

Post a Comment