Take the 2-minute tour ×
Webmasters Stack Exchange is a question and answer site for pro webmasters. It's 100% free, no registration required.

I have a website build using Q2A engine

Since I have about 600 active users there, I'm trying to create a copy of it on a second server for test purposes only.

I've copied all the files and exported the website (about 28MB raw SQL / 8MB .gz file), but when I'm trying to import it on a new server I get the error:

SELECT USER(
);



MySQL returned error:  
#2006 - MySQL server has gone away

What could go wrong?

I've tried several methods: importing raw sql file, gz file, importing on clean database, import on top of installed fresh copy of q2a etc... always the same error.

share|improve this question
    
Thanks for updating with a solution - please add it below as an answer and check it when you can so the question can be considered closed. –  dan Dec 15 '13 at 20:02
add comment

3 Answers 3

up vote 2 down vote accepted

OK I managed to get it work. I chopped the sql export and exported separately: the structure (1 file) and the data up to 5 tables at a time.

Importing the data on a new server in such pieces returned no error.

share|improve this answer
add comment

First perform:

Mysqldump --all-databases > all.sql

Then do:

mysql < all.sql

share|improve this answer
add comment

For complete DB backup, make sure that all store procedures and functions are exported with SQL dump or export.

Use the following command to backup and restore database routines.

Step 1:

mysqldump -u mysql_user   -p   --no-create-db --no-create-info --no-data --routines     
source_db_name  >  dump.sql

Step 2. Restore dump on target database:

mysql  -u  mysql_user -p user_password      
target_DB_name  < dump.sql
share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.