Creating New Droplet using Snapshot Image (MySQL connection issues)

  • Posted on August 24, 2013
  • troyAsked by troy

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.



Submit an answer

This textbox defaults to using Markdown to format your answer.

You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!

Sign In or Sign Up to Answer

These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.

Want to learn more? Join the DigitalOcean Community!

Join our DigitalOcean community of over a million developers for free! Get help and share knowledge in Q&A, subscribe to topics of interest, and get courses and tools that will help you grow as a developer and scale your project or business.

Ok, thanks.

You can just set it to so it would listen on the local interface, or if you want it to listen on all interfaces.

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. <br> <br>sudo nano /etc/MySQL/my.cnf <br> <br>Go to the line that says “bind-address” and change the IP address to your new droplet server IP address.
<br> <br>Cheers, <br> <br>Troy