【问题标题】:MySQL stops when exporting data from a table with large data从包含大数据的表中导出数据时 MySQL 停止
【发布时间】:2020-03-14 21:42:42
【问题描述】:

当我从包含大数据的表中导出数据时,MySQL 正在停止。

mysqldump:错误 2013:在查询期间在第 132371 行转储表 sales_entry_details 时丢失与 MySQL 服务器的连接

MySQL 因另一个我无法解决的原因而停止。所以我决定导出它然后显示上述错误。

此表包含 372882 行。

什么可能导致 MySQL 停止??

是否有任何配置要更改?

我从错误日志中得到了这些:

2019-11-19T11:42:19.074634Z 0 [Note] Executing 'SELECT * FROM 
INFORMATION_SCHEMA.TABLES;' to get a list of tables using the deprecated partition engine. You may use the startup option '--disable-partition-engine-check' to skip this check. 
2019-11-19T11:42:19.076626Z 0 [Note] Beginning of list of non-natively partitioned tables
2019-11-19T11:42:19.144444Z 0 [Note] End of list of non-natively partitioned tables
2019-11-19T11:43:15.348723Z 0 [ERROR] InnoDB: Operating system error number 23 in a file operation.
2019-11-19T11:43:15.351602Z 0 [Note] InnoDB: Some operating system error numbers are described at http://dev.mysql.com/doc/refman/5.7/en/operating-system-error-codes.html
2019-11-19T11:43:15.355585Z 0 [ERROR] InnoDB: File .\retech\sales_entry_details.ibd: 'Windows aio' returned OS error 123. Cannot continue operation
2019-11-19T11:43:15.359611Z 0 [ERROR] InnoDB: Cannot continue operation.
2019-11-19T11:43:18.994689Z 0 [Note] InnoDB: FTS optimize thread exiting.
2019-11-19T11:44:56.106058Z 0 [Warning] InnoDB: 13 threads created by InnoDB had not exited at shutdown!

【问题讨论】:

  • 已经回答了一个类似的问题 - here。看看这是否有帮助?
  • MySql 没有停止。您失去了连接,可能是因为您设置了超时时间
  • @nacho 我检查了服务,似乎 MySQL 已停止!!!
  • `SHOW VARIABLES LIKE '%timeout%';`` 在超时之前它运行了多长时间?

标签: mysql sql database mariadb


【解决方案1】:

就我而言,当 mysql 出现故障时,我通常会在以下任一方面发现问题:

tail /var/log/mysql/error.log

或:

OOM 问题(类似于来自dmesgOut of memory in UB : OOM killed process xxx (mysqld))。

如果出现 OOM 问题,recalculate 内存并在 my.cnf 中调整 innodb_buffer_pool_size

【讨论】:

  • 我更改了innodb_buffer_pool_size,但还是同样的错误,我添加了一些日志报告
  • 错误23是“文件表溢出”,意思是“mysql无法打开更多文件”。检查lsof 并在my.cnf 中调整open_files_limit 变量。 (或者它可能超过了 mysql bin 目录中可以创建的最大文件数)。
  • open_files_limit 的值是 4161。现在我增加了它,但仍然显示相同的错误,解决方法是什么?
  • lsof | grep mysql | wc -l 说什么??
  • 我对windows了解不多,但我刚刚对它进行了一些研究,并且有一个名为sysinternal的外部工具。结帐docs.microsoft.com/en-us/sysinternals/downloads/handle
猜你喜欢
  • 1970-01-01
  • 2021-05-25
  • 1970-01-01
  • 1970-01-01
  • 2017-04-07
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
相关资源
最近更新 更多