Solve MySQL server has gone away while importing large SQL file in 4 easy steps
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
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.
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
defaults-extra-file (the file specified with –defaults-extra-file=path, if any)
find / add
wait_timeout = 600
max_allowed_packet = 64M
Now simply restart MySQL using:
sudo /etc/init.d/mysql restart
Leave a Comment
Subscribe: Trusted By 1M+ Readers
Get the weekly Tech Update straight to your inbox.