Well, I'd include the database name (and drop the auth stuff - I assume people know part - could be an incorrect assumption!)
mysql dbname < mybigfile.sql
The issue here is most likely the server's "max_allowed_packet" setting. If it's set to 32megs and your inserts are "extended" (meaning an entire table in one line), then I don't think even the above will work. However, you can try this right away (setting 200M to something bigger than your SQL file):
mysql --max_allowed_packet=200M dbname < mybigfile.sql
The server has its own value for this, which you can find with:
mysql -e 'show variables like "max_allowed_packet"'
The value here is in bytes. If this is smaller than your file size, you're gonna have problems. The easiest solution would be to restart the server after adding this to the "[mysqld]" portion of your /etc/my.conf (or my.ini file for Windows, in the MySQL server directory):
[mysqld]
max_allowed_packet=200M
Again, I'm assuming you received an "extended-insert" dump. If you performed the dump from another server, redo your dump with:
mysqldump --extended-insert=0 dbname > bigfile.sql
The file will actually be somewhat bigger, but the INSERTs will be broken up on many lines instead of one. If someone just sent this to you, you're only option is to reset max_allowed_packet on the server as I described above.
If you insist on phpMyAdmin....
I don't use phpMyAdmin much, but I see in my 'config.inc.php' several lines that contain '32M' - you might try changing these to bigger values to see if that gets it to work.
Main Topics
Browse All Topics





by: fcardinauxPosted on 2009-08-27 at 21:21:55ID: 25204939
With your command-line interface:
mysql -u root -p < mybigfile.sql