Forum Moderators: phranque
When running a large .sql query (e.g. an entire database dump), I receive an error "No SQL Query".
This is not a "Browser Timeout" issue, as I have tried running these SQL files from the unix command line and received the same error. The cause, seems to be due to the .sql file being over a certain size (possibly 2mg).
The only solution I know of, is to chop up the .sql file into lots of smaller ones. I'm sure there must be a better solution.
Any help gratefully received!
[mysql.com...]
I don't know if that will help or not. I assume you have scoured the .sql file in question to see if it is ok. Have you tried executing each piece individually to make sure they all work?
The sql code is an sql dump (using phpmyadmin). I have suffered with this problem loads of times, on different servers etc..
I have moved peoples sites from one server to another and had to dump/restore the data to the new server. Generally, I find no problem until the .sql dump is over 2meg. I then find that the only way to run it is to split the dump into multiple files (e.g. one per table) but even so, with some databases where for example the products table contains over 2000 records, I have to edit the dump for products with notepad to split it into 2 or 3 files before it is small enough to run.
Do a <?php phpinfo();?> and check your upload_max_filesize setting. You may need to change it in php.ini. Sounds like its too small.
That won´t solve the problem danec since I also suffer with this error attempting to restore from .sql backups in ssh command line prompt and a php setting has little bearing on ssh.
BTW I never encountered that problem myself.
Andreas
Yes, I tried ssh and had the same problem!
The closest I can get to a solution, is to use cpanel to backup/restore. This seems to be able to handle much larger dumps, as they are in gzip format, which makes me think that there must be an answer, as it must effectively be gunzipping before executing with no error.
Andreas
Some things to try is using different options on phpMyAdmin's backup page (ie, complete inserts... etc), or use a different program to back the server up, like mysqlhotcopy or mysqldump. One of the things I've noticed (I don't know this applies to you, since you've said that you can split your files up) is that phpMyAdmin sometimes creates these crazy sql files in which all the rows in a given table is actually represented in 1 line without any line breaks. Perhaps using different options when backing up will fix the problem.
I have come across a problem similar to yours, but it was because memory module was bad and it was changing some bits of the file at random points. :)