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 

2 comments:

Milena Silva said...

sino tambien puede usar

MySQL Workbench

como se muestra acá

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

Deepa said...

Gone through this wonderful coures called Salesforce Certification Training in Dallas who are offering fully practical course, who parent is Salesforce Training in USA and they have students at Salesforce Training classes in Canada institutes.