Remote access mysql ubuntu 12.04

February 13, 2014 14.9k views
I have two droplets with lamp installation.I enabled private networking to both instances. I referred links given below and configured them according to mentioned steps. Then I started Mysql service and I have created user and granted it full permission via these commands. CREATE USER 'webadmin'@'localhost' IDENTIFIED BY 'password'; GRANT ALL PRIVILEGES ON * . * TO 'webadmin'@'localhost'; CREATE USER 'webadmin'@'%' IDENTIFIED BY 'password'; GRANT ALL PRIVILEGES ON * . * TO 'webadmin'@'%'; I want to enable remote access to Mysql Server that's why I need to change the bind-address in /etc/mysql/my.cnf file. I have changed to bind-address = Then I restarted mysql service. now I am trying to connect to mysql server from another droplet. mysql -u webadmin -p -h xx.xx.xx.xx I got error 2003(HY000). and also lsof -i -P | grep :3306 command returns nothing. Am I making any mistake??
1 comment
4 Answers
lsof -i -P | grep :3306 command returns nothing.
That means MySQL is not running. Try starting it:
sudo service mysql start
Hi mahiyar,

Everything seems to be ok in the MySQL configuration file but, can you post the output of netstat -ntulp
I have a similar problem:

Trying to get remote access to the mysql server on Magento server (

I have created a DB user with access from remote servers host = %
And I have altered the bind-address in my.cnf file to be

I then did a mysql restart and a server reboot (just in case).

I checked that the port was LISTEN(ING). And all looks good there:
tcp 0 0* LISTEN

However I still cannot connect remotely -
"ERROR 2013 (HY000): Lost connection to MySQL server at 'waiting for initial comunication packet', system error: 0"

Have I missed a step?

This article really helpful to me.

Actually i would like to make remote database connection in my development team.

I have to share database design every time manually but i search through google and found this link it is really help full.


Have another answer? Share your knowledge.