The MySQL server has gone away is a very common error that simply means the server (MySQL) went offline while it was working on something.
This is most commonly noted on executing a large SQL dump file or running a complex query, in the article we will case one.
Table of Contents
Download SQLYog
SQLYog is a client-side tool that I am using personally for a long time. This helps me to run a query on my desktop directly in place of using famous PHPMyAdmin.
Locate my.cnf
The MySQL default configuration is not very great for production use. Some of the default values in my.cnf
should be changed when you need it for business-critical applications
Location of my.cnf :
sudo nano /etc/mysql/my.cnf
or
/etc/my.cnf
or
/etc/mysql/my.cnf
or
SYSCONFDIR/my.cnf
or
$MYSQL_HOME/my.cnf
or
defaults-extra-file (the file specified with –defaults-extra-file=path, if any)
or
~/.my.cnf
Edit my.cnf
find / add
wait_timeout = 600
max_allowed_packet = 64M
Restart MySQL
Now simply restart MySQL using:
sudo /etc/init.d/mysql restart
Shashi kant Pandidhar
Leave a Comment
About Me
Shashi kant Pandidhar
Related Posts
Follow Us
Ads
Subscribe: Trusted By 1M+ Readers
Get the weekly Tech Update straight to your inbox.