简体   繁体   English

导入sql文件时发生内部服务器错误?

[英]Internal server error while importing sql file?

I am importing an SQL file and it shows me an error like this 我正在导入一个SQL文件,它显示出这样的错误

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. 请通过admin@example.com与服务器管理员联系,以告知他们该错误发生的时间以及您在该错误发生之前执行的操作。 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 我已经在以下列出的php.ini文件中进行了更改

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. 检查您的/var/log/apache2/error.log(或使用什么服务器?),其中包含完整的错误描述。

  2. Import big SQL files via ssh/mysql client: 通过ssh / mysql客户端导入大型SQL文件:

    mysql -u username -p dbname < /path/to/sql/file.sql mysql -u用户名-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. @ BaBL86是正确的,这在WAMPServer和Windows上是有效的解决方案,您只需要执行以下操作即可。

Run the MySQL command prompt as follows: 运行MySQL命令提示符,如下所示:

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. 输入您的“ root”用户帐户的密码,或者如果您尚未设置密码,则只需按Enter。

Now enter the following at the Mysql prompt 现在在Mysql提示符下输入以下内容

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

Also if you have really set the parameters in the php.ini like you say you have 另外,如果您真的像在您说的那样在php.ini中设置了参数,

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. 但是,使用MySQL控制台,您可以将它们全部设置回找到它们的方式,因为它不受phpMyAdmin这样的任何PHP限制的影响。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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