daniloaz / myphp-backup

Simple and fast MySQL backups using PHP
GNU General Public License v3.0
201 stars 115 forks source link

MySQL server has gone away #6

Closed cavo789 closed 5 years ago

cavo789 commented 5 years ago

Very nice work! Congrats!

No problem with the backup script but well with the restore one. Here is the error message:

Warning: mysqli_query(): MySQL server has gone away in myphp-restore.php on line 157

The .sql file is big (more than 25MB); I think it's somethink like a timeout but the script runs fast in fact. I quickly receive this error then the script stop.

Thanks

daniloaz commented 5 years ago

Hi! Thank you for your feedback. I think your error message is not due to file size, as the restoration script processes the SQL file line by line and performs multiple queries. Please, try these tips and if you continue to have these error messages let's reopen the issue: https://matomo.org/faq/troubleshooting/faq_183/

Thanks!

samsong commented 4 years ago

Change the insert statements in the backup file to 1 per row. I had same problem. Is the fault of the batchsize too large. The script should be updated to have option of 1 insert statement per row.