Configuration changes on MySQL to accept remote connections from a particular ipaddress
now edit my.cnf depending on your Linux
vi /etc/mysql/my.cnf
Make sure line skip-networking is commented
Add line
*yourdatabasename is replace by your database name
- If you are using Debian Linux file is located at /etc/mysql/my.cnf location
- If you are using Red Hat Linux/Fedora/Centos Linux file is located at /etc/my.cnf location
- If you are using FreeBSD you need to create a file /var/db/mysql/my.cnf
now edit my.cnf depending on your Linux
vi /etc/mysql/my.cnf
Make sure line skip-networking is commented
Add line
bind-address=YOUR-SERVER-IP
exit my.cnf file after saving...
/etc/init.d/mysql restart
open mysql prompt
mysql -u root -p mysql
GRANT ALL ON yourdatabasename.* TO username@'your-ipaddress' IDENTIFIED BY
'PASSWORD';
*yourdatabasename is replace by your database name
*your-ipaddress
is replaced by ip address of remote machine from
which you want to connect to MySql database