| Enable Remote Access |
|
|
|
| How To - MySQL | |
| Written by Christian Foronda | |
| Wednesday, 17 March 2010 13:40 | |
|
By default, MySQL database server remote access disabled for security reasons. However, some time you need to provide the remote access to database server from home or from web server. Login over ssh: First, login over ssh to remote MySQL database server Enable networking: Once connected you need edit the mysql configuration file my.cnf using text editor such as vi. In Debian Linux file is located at /etc/mysql/my.cnf # vi /etc/my.cnf Comment the line skip-networking: # skip-networking Add following line: bind-address=YOUR-SERVER-IP For example, if your MySQL server IP is 172.20.5.2 then entire block should be look like as follows: [mysqld] user = mysql pid-file = /var/run/mysqld/mysqld.pid socket = /var/run/mysqld/mysqld.sock port = 3306 basedir = /usr datadir = /var/lib/mysql tmpdir = /tmp language = /usr/share/mysql/English bind-address = 172.20.5.2 # skip-networking .... .. .... Where, Grant access to remote IP address: # mysql -u root -p mysql mysql> CREATE DATABASE foo; mysql> GRANT ALL ON foo.* TO username@'remoteip' IDENTIFIED BY 'password'; Test it: From remote system type command $ mysql -u USERNAME -h SERVERIP –p Similar articles
|
|
| Last Updated on Wednesday, 17 March 2010 13:46 |


