FCI-Helwan blog

Just another FCI-H weblog

Enabling remote access to Mysql

A very common problem when using Mysql is when you try to remotely connect to the server, the solution is very simple and direct.

Configuration:
1- find a file named “my.cnf”, this file contains the server configurations.
2- if you find a line with this syntax “skip-networking”, comment it by putting a “#” in the begining of the line.
3- if you find a line with this syntax: bind-address = 127.0.0.1, comment it as well, this line tells mysql to accept connections only from localhost.

Persmissions:
now, you have to tell mysql who is to access the server with what permissions
1- login to mysql(example using root user name) : mysql -uroot -p
2- suppose that the data base we need to make available is named koko, so to make koko available to root with password ‘password’ at the machine with address 192.168.1.5 we write:
GRANT ALL on koko.* TO ‘root’@’192.168.1.5’ IDENTIFIED BY ‘password’;
3- then write : FLUSH PRIVILEGES;

Note: do not forget to restart mysql to reload configurations in the my.cnf file.

Advertisements

November 2, 2008 - Posted by | MySQL

No comments yet.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: