Showing posts from May, 2012

How to enable remote access to mysql database server

Enable remote access to mySQL database server 1. Open the MySQL server configuration file my.cnf. sudo gedit /etc/mysql/my.cnf 2. Change the bind-address value to your MySQL server ip. If the MySQL server IP=, change it as follows, save and close my.cnf file. bind-address= 3. Now Grant access to remote IP. If the remote IP=   Grant permission to a specific database (ex: testbd) GRANT ALL ON testdb.* TO testuser@'' IDENTIFIED BY 'test123'; Grant all permissions GRANT ALL PRIVILEGES ON *.* TO testuser@''  IDENTIFIED BY 'test123'  WITH GRANT OPTION; 4. Open port 3306, if firewalls are enabled. Following is a sample iptables rule to open Linux iptables firewall. /sbin/iptables -A INPUT -i eth0 -p tcp --destination-port 3306 -j ACCEPT 5. logout of mysql. 6. Connect from remote host mysql -u root -h -p