prokaryote prokaryote - 3 months ago 23
MySQL Question

import mysql database exported with phpmyadmin into local lamp stack

I exported mydb.sql from phpMyAdmin. It is about 0.9GB in size.

I copied mydb.sql onto an external hard drive, plugged that drive into another computer on which I just installed a LAMP stack.

On that new computer, in Ubuntu 14.04, from terminal, I type

mysql -u -p, and log into mysql.

Then I type

mysql> use mydb
mysql> source mydb.sql


Boom! It takes off. But within five minutes, failure:

ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '<br />
<b>Fatal error</b>: Maximum execution time of 300 seconds exceeded in <b' at line 83


It appears from lots of google searches that this has to do with my php.ini file and its max_execution_time and other limits. I have changed that file to up those limits, but I still get the same error.

Any ideas? I thought that bringing
mydb.sql
in via the mysql command line would not involve php, but apparently it does.

Answer
ERROR 1064 (42000): You have an error in your SQL syntax;
check the manual that corresponds to your MySQL server version for the right syntax to use near 
'<br /><b>Fatal error</b>:  Maximum execution time of 300 seconds exceeded in <b' at line 83

This line should not be in your mydb.sql. This question has been tagged phpmyadmin so it's easy to guess that the data was exported with it but the script was terminated when it reached 300 seconds which is the max allowed on your server.

You have two options:

1) change your php.ini to increase the max execution time

2) dump the database using mysqldump