所以我有一台新电脑,我正在尝试为一些项目设置一切。
当我尝试导入某些数据库时,在 phpmyadmin 中导入失败后收到此消息:
Missing expression. (near "ON" at position 25)
SET FOREIGN_KEY_CHECKS = ON;
MySQL error 2006: mysql server has gone away
我从 phpmyadmin 注销了,尽管导入只需要几秒钟。
我已经阅读了一些提示并且我已经这样做了:
- 设置 my.cnf 值,例如:
[mysql]
max_allowed_packet=512M
[mysqld]
max_allowed_packet=512M
wait_timeout=600
interactive_timeout = 86400
- 并将我的 php.ini 调整为:
max_execution_time = 500
max_input_time = 500
memory_limit = 512M
post_max_size = 512M
upload_max_filesize = 256M
- 尝试通过命令行导入:
mysql -u USER -p database < import.sql
命令行给我这个错误:
ERROR 2013 (HY000) at line 12042: Lost connection to MySQL server during query
显然这不仅仅是一些 php 的东西。
导入好像失败了。我尝试了多个数据库。有些是 10MB,有些是 120MB。如果我启动一个新的 Web 应用程序或 WordPress 实例,一切都会正常工作并且根本没有错误。但失败的数据库也应该可以正常工作。至少在制作、舞台和我以前的工作机器上是这样。
所以我在这里有点迷失了。
以下是当前版本:
Ubuntu 20.04
mysql Ver 8.0.27-0ubuntu0.20.04.1 for Linux on x86_64 ((Ubuntu))
PHP 7.4.25 (cli) (built: Oct 22 2021 12:34:33) ( NTS )
phpmyadmin 4:4.9.5+dfsg1-2
Update:我查看了mysql的error.log:
2021-10-29T13:10:12.337942Z 0 [System] [MY-010931] [Server] /usr/sbin/mysqld: ready for connections. Version: '8.0.27-0ubuntu0.20.04.1' socket: '/var/run/mysqld/mysqld.sock' port: 3306 (Ubuntu).
2021-10-29T13:14:31.622915Z 0 [ERROR] [MY-013183] [InnoDB] Assertion failure: ddl0builder.cc:1495:n >= IO_BLOCK_SIZE thread 140053145696000
InnoDB: We intentionally generate a memory trap.
InnoDB: Submit a detailed bug report to http://bugs.mysql.com.
InnoDB: If you get repeated assertion failures or crashes, even
InnoDB: immediately after the mysqld startup, there may be
InnoDB: corruption in the InnoDB tablespace. Please refer to
InnoDB: http://dev.mysql.com/doc/refman/8.0/en/forcing-innodb-recovery.html
InnoDB: about forcing recovery.
13:14:31 UTC - mysqld got signal 6 ;
Most likely, you have hit a bug, but this error can also be caused by malfunctioning hardware.
Thread pointer: 0x0
Attempting backtrace. You can use the following information to find out
where mysqld died. If you see no messages after this, something went
terribly wrong...
stack_bottom = 0 thread_stack 0x100000
也许有人遇到过这个?