简体   繁体   中英

Internal server error while importing sql file?

I am importing an SQL file and it shows me an error like this

Internal Server Error

The server encountered an internal error or misconfiguration and was unable to complete your request. Please contact the server administrator at admin@example.com to inform them of the time this error occurred, and the actions you performed just before this error. More information about this error may be available in the server error log.

I have already make changes in php.ini file, which are listed below

MAX_UPLAOD_SIZE = 20M
MAX_EXECUTION_TIME = 600
POST_MAX_SIZE = 20M

How to resolve this?

  1. Check your /var/log/apache2/error.log (or what server do you use?) It contains a full error description.

  2. Import big SQL files via ssh/mysql client:

    mysql -u username -p dbname < /path/to/sql/file.sql

@BaBL86 Is correct, that is a valid solution on WAMPServer and Windows, you just need to do the following.

Run the MySQL command prompt as follows:

left click the WampManager icon -> MySQL -> MySQL Console

Enter the password for your 'root' user account or if you have not set one yet just hit enter.

Now enter the following at the Mysql prompt

source C:/path/to/your/backup.sql

Also if you have really set the parameters in the php.ini like you say you have

MAX_UPLAOD_SIZE = 20M
MAX_EXECUTION_TIME = 600
POST_MAX_SIZE = 20M

Set them properly

upload_max_size = 20M
max_execution_time = 600
post_max_size = 20M

But using the MySQL Console you can set them all back to the way you found them as that is not affected by any PHP limitations like phpMyAdmin is.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM