How to accept remote connections on MySQL

Configuration changes on MySQL to accept remote connections from a particular ipaddress

  • 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 

1 comment:

Milena Silva said...

sino tambien puede usar

MySQL Workbench

como se muestra acá

http://www.lucianoaibar.com/tutoriales/mysql-remoto