Creating New Droplet using Snapshot Image (MySQL connection issues)

August 24, 2013 3.4k views
Hi. I took a snapshot of one of my droplets, it's the only snapshot I have. The snapshot includes a working MySQL database with login credentials. After creating a new droplet using the snapshot image I'm able to login with root using the new password, but I'm unable to log into MySQL using the login credentials I created within the snapshot image. I also tried using the new password for root generated when creating a new droplet. The error message is: ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock' (2) Could you someone please help assist? The original droplet that I took the snapshot image that was used for the new droplet works perfectly fine when logging into MySQL with login credentials. Thanks, Troy
6 Answers
MySQL seems to be down -- try starting it:

sudo service mysql start
Hi. I just tried the above, but the error message is saying:

start: Job failed to start

Do you know what might be the problem?


What's the output of this command?

tail /var/log/mysql.err
Figured it out. I forgot to change the bind IP address within the /etc/MySQL/my.cnf file. For those learning like me you can run the following code. Please keep in mind security issues when using the steps below, this only for learning purposes.

sudo nano /etc/MySQL/my.cnf

Go to the line that says "bind-address" and change the IP address to your new droplet server IP address.


You can just set it to so it would listen on the local interface, or if you want it to listen on all interfaces.
Have another answer? Share your knowledge.