simple 4 steps to solve Mysql server has gone away while importing large sql file
Mysql server has gone away is a very common error which is simply mean the server (mysql) went offline while it was working on something.
This is most commonly noted on executing large sql dump file or running a complex query, in the article we will case one.
- Download SQLYog :
SQLYog is a client side tool which I am using personally from long time. This help me to run 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.cnfshould be changed when you need it for business critical applications
Location of my.cnf :
- [su_code]sudo nano /etc/mysql/my.cnf[/su_code]
- [su_code]defaults-extra-file (the file specified with –defaults-extra-file=path, if any)[/su_code]
- edit my.cnf :
find / add
[su_code]wait_timeout = 600
max_allowed_packet = 64M
- Restart MYSQL :
now simply restart mysql using : [su_code]sudo /etc/init.d/mysql restart[/su_code]