I had this error
MySQL -Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock
Turns out it was because I didnt have any more disk space left, so the mysql service refused to restart. Suppose I add a volume to DigitalOcean Droplet, do I need to confgure anything for mysql to use that diskspace ?
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.
Click below to sign up and get $100 of credit to try our products over 60 days!
Hello,
It really depends on how you’ve done your partitioning. You could run this command here to make sure that the extra space is now availalbe:
Also if the extra space is availalbe you could just start your MySQL service with this command:
Hope that this helps! Bobby
@ufoundashish
Attaching a Volume to your Droplet will not automatically increase the disk space available on the local SSD. Currently, the only way to increase local storage would be to resize your Droplet.
When it comes to Volumes, they function much like an external disk plugged into your PC or Mac would–they will provide additional storage, though on a separate mount point than the local disk.
Since MySQL is installed on the local disk by default, you would need to migrate the data directory to the volume (ensuring permissions are maintained). You would then need to update the data directory that MySQL uses to ensure that, once restarted, it pulls information from the volume.
We have a guide that covers changing the data directory and moving the MySQL data over to a volume here.
Note: I would highly recommend taking a Snapshot of your Droplet before proceeding to ensure that you have a working backup in case something goes wrong.