Tuesday, November 29, 2011

Allowing remote connection in MySQL

When using MySQL, sometime you want to allowing remote connection (from different server)

Run mysql command line console. Usually in /usr/bin/mysql or /usr/local/mysql/bin/mysql

Your shell prompt should be like this

mysql>

Run this command

GRANT ALL PRIVILEGES ON *.* TO USERNAME@IP IDENTIFIED BY "PASSWORD";

Then

FLUSH PRIVILEGES;

Please change USERNAME, IP, PASSWORD, base on your need.
For example:

GRANT ALL PRIVILEGES ON *.* TO root@192.168.1.20 IDENTIFIED BY "MySecretPassword";





No comments: