views:

712

answers:

5

if my host does not allow me to upload a file directly to my mysql folder and i can only do so throught phpmyadmin? are there any alternatives aside from its native import feature so that my connection would not time out while uploading a query that's around 8mb?

+8  A: 

you can gzip or bzip the file and phpMyAdmin will decompress and run the script.

otherwise what I've had to do in the past is split my SQL into a number of files and load each one individually. You can do this simply by opening the SQL file in a text editor, scroll to about half way down, find the start of a statement and move everything after that into another file.

nickf
I would have said exactly the same thing.
Philip Morton
+1  A: 

Don't use phpmyadmin for anything critical. Definitely don't use it to create backups or do restoration. It's a bag of rubbish.

Log on to your shell and use the mysql command line client to restore the database in the standard way. If you can't do that, get a better provider.

Shell access is necessary to work with mysql databases.

Don't expect anything done with phpmyadmin NOT to destroy all your data.

MarkR
did you learn that the hard way ?
andyk
lol. Always do backups before anything critical. I've been using phpmyadmin for years, but only after I back up the database using a bash script. Never had to restore back to it.
sirlancelot
"How do I do X in Y?" ... "Don't use Y it's rubbish." Not a useful answer IMO.
nickf
A: 

The best way is to use shell mysql command line. It's safer, easyer...

A: 

BigDump?

Staggered import of large and very large MySQL Dumps (like phpMyAdmin 2.x Dumps) even through the web servers with hard runtime limit and those in safe mode. The script executes only a small part of the huge dump and restarts itself. The next session starts where the last was stopped.

You could upload the dump with an FTP client (which will allow you to resume the transfer), and load it locally.

dbr
phpMyAdmin does this now too. If it times out on a large file, it tells you what record it was up to. you can then do the restore again, and just tell it the record number and it'll pick it up from there.
nickf
A: 

I would definitely say BigDump. i had this exact problem with 8.3 GB sql file. read this article for more info. How To Upload a Big SQL File To MySQL also visit the script home page to download it.

amindzx