By ufoundashish
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 ?
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!
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:
df -h
Also if the extra space is availalbe you could just start your MySQL service with this command:
systemctl start mysql
Hope that this helps! Bobby
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.
Get paid to write technical tutorials and select a tech-focused charity to receive a matching donation.
Full documentation for every DigitalOcean product.
The Wave has everything you need to know about building a business, from raising funding to marketing your product.
Stay up to date by signing up for DigitalOcean’s Infrastructure as a Newsletter.
New accounts only. By submitting your email you agree to our Privacy Policy
Scale up as you grow — whether you're running one virtual machine or ten thousand.
Sign up and get $200 in credit for your first 60 days with DigitalOcean.*
*This promotional offer applies to new accounts only.