simple 4 steps to solve Mysql server has gone away while importing large sql file

Search a domain

www.
simple 4 steps to solve Mysql server has gone away while importing large sql file
  • 22
    Feb

simple 4 steps to solve Mysql server has gone away while importing large sql file

Shashi kant Pandidhar

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.

  1. 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.
  2. 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
    • /etc/my.cnf
    • /etc/mysql/my.cnf
    • SYSCONFDIR/my.cnf
    • $MYSQL_HOME/my.cnf
    • defaults-extra-file (the file specified with –defaults-extra-file=path, if any)
    • ~/.my.cnf
  3. edit my.cnf :
    find / add
    wait_timeout = 600
    max_allowed_packet = 64M
  4. Restart MYSQL :
    now simply restart mysql using : 
    sudo /etc/init.d/mysql restart
About Shashi kant Pandidhar

I’ve been helping businesses to be online for over 15 years. Today my team and I focus on helping real businesses to over come high traffic challenges and even get more traffic by improving how Google rates your website.

Comments