tags:

views:

49

answers:

2

i have setup mysql on a webserver. i have an 8mb file with sql code to create tables. im using the phpmyadmin IMPORT FILE feature, but for some reason it gets stuck and gives me the 500 Internal Server Error

The server has encountered an internal error or misconfiguration and was unable to complete your request.

. what is the best way for me to run 8mb of sql code on this thing?

+1  A: 

If you have access to the php.ini file, increase the upload file size limit. Otherwise you need to compress the file before uploading, or to split your file into smaller ones.

Zed
+3  A: 

A 8 MB dump is probably a bit too big : there are several parameters that can be a source of problems :

  • Your server might not accept uploads that big
  • Importing the data could take too much time (exceeding the PHP max_execution_time, for instance)


If you have a command-line access to your server (via SSH, for instance), a solution would be to use the mysql command to import the dump ; something like this might do :

mysql --user=USER --password=PASSWORD DBNAME < YOUR_DUMP_FILE

(I've imported dumps of several hundreds MB this way -- takes some times, but works nice ^^ )

Of course, with that, the dump file must already be on the server -- you can probably upload it via FTP ?


If you don't have a command-line access to your server, maybe running that command via a PHP script, using the system function, would be possible ?


If neither those ideas work... Well, I'm guessing you will have to split your file by hand, to import small chunks ; using files between 1MB and 2MB should work fine, considering the default configuration options that are often used for PHP...

Pascal MARTIN
rascal your syntax isnt working for me please help
I__
@avrohom : what do you call "not working" ? What exactly did you try ? Did you get an error ? Which one ?
Pascal MARTIN