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?

lock
  • 6,404
  • 18
  • 58
  • 76

6 Answers6

14

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
  • 537,072
  • 198
  • 649
  • 721
1

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
  • 62,604
  • 14
  • 116
  • 151
  • 1
    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. – matpie Jan 09 '09 at 08:15
  • 1
    "How do I do X in Y?" ... "Don't use Y it's rubbish." Not a useful answer IMO. – nickf Feb 02 '10 at 13:49
  • phpmyadmin is not the standard way of creating mysql backups, and previous versions have created unrestorable backups. Also, becuase it runs in PHP it often has a limited script run time which a backup will exceed. Some people have found that backups created by phpmyadmin cannot be restored. The mysqldump tool has been extensively tested; phpmyadmin contains a re-implementation of the tool which has not. – MarkR Aug 30 '12 at 13:44
0

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.

MoeAmine
  • 5,976
  • 2
  • 18
  • 21
0

See my answer here: https://stackoverflow.com/a/33728744/74585

If during an import operation you untick Partial import -> Allow the interruption of an import... then phpMyAdmin seems to send the entire thing to mysql which is processed slowly. Unfortunately phpMyAdmin (at least on my shared host) will no longer respond to requests, but using a browser on a different IP address works and let's you monitor the query's progress.

Community
  • 1
  • 1
Matthew Lock
  • 13,144
  • 12
  • 92
  • 130
0

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
  • 165,801
  • 69
  • 278
  • 343
  • 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 Jan 10 '09 at 12:15
-1

I say - use Sypex Dumper.

Vladislav Rastrusny
  • 29,378
  • 23
  • 95
  • 156