欢迎各位兄弟 发布技术文章

这里的技术是共享的

You are here

PhpMyAdmin Import Error-MySQL server has gone away/Unrecognized Keyword 错误 静态分析: 分析时发现1个错误。 Missing expression. (near "ON" at position 25) SQL 查询: 编辑 编辑 SET FOREIGN_KEY_CHECKS = ON; MySQL 返回: 文档 #2006 - MySQL server has gone away 有大用

So I've exported a MySQL database from PHPMyAdmin (which I access from within IIS Express on a Windows 8 machine) and I'm trying to import this database onto another machine, however on that machine I receive the following errors:

ErrorWarning1Warning2

Please help. I need to be able to restore this database and I have no idea how to fix this.

I tried going into the sql file and changing the foreign key line in the sql file (it was set to 0), but that didn't make a difference. Where is it set to ON? I can't figure that out.

1 Answer 正确答案

Changing the MySQL settings worked. This is what I changed, exactly:

In php.ini

Find:

post_max_size = 8M
upload_max_filesize = 2M
max_execution_time = 30
max_input_time = 60
memory_limit = 8M

Change to:

post_max_size = 750M
upload_max_filesize = 750M
max_execution_time = 5000
max_input_time = 5000
memory_limit = 1000M

In my.ini (MySQL File)

Under mysqld add: max_allowed_packet = 500M

来自 https://dba.stackexchange.com/questions/121032/phpmyadmin-import-error-mysql-server-has-gone-away-un...


普通分类: