Here is the complete error that I’m getting:
Warning: mysqli_real_connect(): (HY000/2002): Can’t connect to local MySQL server through socket ‘/var/run/mysqld/mysqld.sock’ (111) in /var/www/thehotskills.com/public_html/wp-includes/wp-db.php on line 1603
Deprecated: mysql_connect(): The mysql extension is deprecated and will be removed in the future: use mysqli or PDO instead in /var/www/thehotskills.com/public_html/wp-includes/wp-db.php on line 1633
Warning: mysql_connect(): Can’t connect to local MySQL server through socket ‘/var/run/mysqld/mysqld.sock’ (111) in /var/www/thehotskills.com/public_html/wp-includes/wp-db.php on line 1633
My site auto stopped working after some time and get the above errors. To solve this problem, I need to restart again-n-again MySql servers.
How I can solve this problem so that I do not need to start servers again-n-again.
Thanks in advance!
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,
This sounds like your MySQL server is being killed. Most likely due to the lack of available RAM.
Make sure to optimize your site so it uses less RAM and maybe consider increasing your RAM as well. Another thing you could do is to add a swap file so that there’s some buffer.
Hope that this helps! Bobby
We can display error message in case of an error generated by mysql query. This meaning full error message gives idea one the problem or bugs in the script. We can print the error message by using mysql function mysql_error(). This function returns the error message associated with most recently executed query.
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.