mysqldump 出错,在查询期间丢失与 MySQL 服务器的连接

标签 mysql

当我使用 mysqldump -uroot -p xxx > xxx.sql 时,我遇到了一些错误,'mysqldump:错误 2013:在查询期间转储表 GAMES 时与 MySQL 服务器失去连接: 20826'。

然后我查看了mysql的错误日志,发现了下面的错误。我在谷歌中搜索了很多网站,但一无所获。

谁能帮我解决这个问题,谢谢!

2018-07-31 00:21:04 0x7fb3cc0ab700  InnoDB: Assertion failure in thread 140410199127808 in file btr0pcur.cc line 452
InnoDB: Failing assertion: page_is_comp(next_page) == page_is_comp(page)
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/5.7/en/forcing-innodb-recovery.html
InnoDB: about forcing recovery.
16:21:04 UTC - mysqld got signal 6 ;
This could be because you hit a bug. It is also possible that this binary
or one of the libraries it was linked against is corrupt, improperly built,
or misconfigured. This error can also be caused by malfunctioning hardware.
Attempting to collect some information that could help diagnose the problem.
As this is a crash and something is definitely wrong, the information
collection process might fail.

key_buffer_size=16777216
read_buffer_size=131072
max_used_connections=1
max_threads=151
thread_count=1
connection_count=1
It is possible that mysqld could use up to
key_buffer_size + (read_buffer_size + sort_buffer_size)*max_threads = 76387 K  bytes of memory
Hope that's ok; if not, decrease some variables in the equation.

Thread pointer: 0x7fb3a4012330
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 = 7fb3cc0aae70 thread_stack 0x30000
/usr/sbin/mysqld(my_print_stacktrace+0x3b)[0xe907ab]
/usr/sbin/mysqld(handle_fatal_signal+0x489)[0x789b49]
/lib/x86_64-linux-gnu/libpthread.so.0(+0x11390)[0x7fb3e79ca390]
/lib/x86_64-linux-gnu/libc.so.6(gsignal+0x38)[0x7fb3e6d83428]
/lib/x86_64-linux-gnu/libc.so.6(abort+0x16a)[0x7fb3e6d8502a]
/usr/sbin/mysqld[0x75f3e0]
/usr/sbin/mysqld(_Z26btr_pcur_move_to_next_pageP10btr_pcur_tP5mtr_t+0x1c8)[0x114e6f8]
/usr/sbin/mysqld[0x75cfbf]
/usr/sbin/mysqld(_Z15row_search_mvccPh15page_cur_mode_tP14row_prebuilt_tmm+0x11e5)[0x1099745]
/usr/sbin/mysqld(_ZN11ha_innobase13general_fetchEPhjj+0x6a)[0xf87a7a]
/usr/sbin/mysqld(_ZN7handler11ha_rnd_nextEPh+0xfc)[0x7d961c]
/usr/sbin/mysqld(_Z13rr_sequentialP11READ_RECORD+0x35)[0xbb3445]
/usr/sbin/mysqld(_Z10sub_selectP4JOINP7QEP_TABb+0x13e)[0xc23ffe]
/usr/sbin/mysqld(_ZN4JOIN4execEv+0x3c8)[0xc1cd18]
/usr/sbin/mysqld(_Z12handle_queryP3THDP3LEXP12Query_resultyy+0x233)[0xc8e753]
/usr/sbin/mysqld[0x7533a8]
/usr/sbin/mysqld(_Z21mysql_execute_commandP3THDb+0x492e)[0xc506ee]
/usr/sbin/mysqld(_Z11mysql_parseP3THDP12Parser_state+0x3ad)[0xc52b3d]
/usr/sbin/mysqld(_Z16dispatch_commandP3THDPK8COM_DATA19enum_server_command+0x102a)[0xc53c7a]
/usr/sbin/mysqld(_Z10do_commandP3THD+0x1c7)[0xc55137]
/usr/sbin/mysqld(handle_connection+0x288)[0xd16788]
/usr/sbin/mysqld(pfs_spawn_thread+0x1b4)[0xec9294]
/lib/x86_64-linux-gnu/libpthread.so.0(+0x76ba)[0x7fb3e79c06ba]
/lib/x86_64-linux-gnu/libc.so.6(clone+0x6d)[0x7fb3e6e5541d]

Trying to get some variables.
Some pointers may be invalid and cause the dump to abort.
Query (7fb3a404ae60): is an invalid pointer
Connection ID (thread ID): 4
Status: NOT_KILLED

The manual page at http://dev.mysql.com/doc/mysql/en/crashing.html contains
information that should help you find out what is causing the crash.
2018-07-30T16:21:04.660409Z 0 [Warning] Changed limits: max_open_files: 1024 (requested 5000)
2018-07-30T16:21:04.660458Z 0 [Warning] Changed limits: table_open_cache: 431 (requested 2000)
2018-07-30T16:21:04.840982Z 0 [Warning] TIMESTAMP with implicit DEFAULT value is deprecated. Please use --explicit_defaults_for_timestamp server option (see documentation for more details).
2018-07-30T16:21:04.842849Z 0 [Note] /usr/sbin/mysqld (mysqld 5.7.22-0ubuntu0.16.04.1) starting as process 26568 ...
2018-07-30T16:21:04.847280Z 0 [Note] InnoDB: PUNCH HOLE support available
2018-07-30T16:21:04.847312Z 0 [Note] InnoDB: Mutexes and rw_locks use GCC atomic builtins
2018-07-30T16:21:04.847319Z 0 [Note] InnoDB: Uses event mutexes
2018-07-30T16:21:04.847324Z 0 [Note] InnoDB: GCC builtin __atomic_thread_fence() is used for memory barrier
2018-07-30T16:21:04.847331Z 0 [Note] InnoDB: Compressed tables use zlib 1.2.8
2018-07-30T16:21:04.847336Z 0 [Note] InnoDB: Using Linux native AIO
2018-07-30T16:21:04.847618Z 0 [Note] InnoDB: Number of pools: 1
2018-07-30T16:21:04.847762Z 0 [Note] InnoDB: Using CPU crc32 instructions
2018-07-30T16:21:04.849397Z 0 [Note] InnoDB: Initializing buffer pool, total size = 128M, instances = 1, chunk size = 128M
2018-07-30T16:21:04.857825Z 0 [Note] InnoDB: Completed initialization of buffer pool
2018-07-30T16:21:04.860275Z 0 [Note] InnoDB: If the mysqld execution user is authorized, page cleaner thread priority can be changed. See the man page of setpriority().
2018-07-30T16:21:04.872370Z 0 [Note] InnoDB: Highest supported file format is Barracuda.
2018-07-30T16:21:04.892980Z 0 [Note] InnoDB: Log scan progressed past the checkpoint lsn 5386460686
2018-07-30T16:21:04.893001Z 0 [Note] InnoDB: Doing recovery: scanned up to log sequence number 5386460695
2018-07-30T16:21:04.893008Z 0 [Note] InnoDB: Database was not shutdown normally!
2018-07-30T16:21:04.893013Z 0 [Note] InnoDB: Starting crash recovery.
2018-07-30T16:21:05.008438Z 0 [Note] InnoDB: Removed temporary tablespace data file: "ibtmp1"
2018-07-30T16:21:05.008468Z 0 [Note] InnoDB: Creating shared tablespace for temporary tables
2018-07-30T16:21:05.008507Z 0 [Note] InnoDB: Setting file './ibtmp1' size to 12 MB. Physically writing the file full; Please wait ...
2018-07-30T16:21:05.103402Z 0 [Note] InnoDB: File './ibtmp1' size is now 12 MB.
2018-07-30T16:21:05.104128Z 0 [Note] InnoDB: 96 redo rollback segment(s) found. 96 redo rollback segment(s) are active.
2018-07-30T16:21:05.104147Z 0 [Note] InnoDB: 32 non-redo rollback segment(s) are active.
2018-07-30T16:21:05.105002Z 0 [Note] InnoDB: 5.7.22 started; log sequence number 5386460695
2018-07-30T16:21:05.105371Z 0 [Note] InnoDB: Loading buffer pool(s) from /var/lib/mysql/ib_buffer_pool
2018-07-30T16:21:05.106533Z 0 [Note] Plugin 'FEDERATED' is disabled.
2018-07-30T16:21:05.112425Z 0 [Note] Found ca.pem, server-cert.pem and server-key.pem in data directory. Trying to enable SSL support using them.
2018-07-30T16:21:05.112600Z 0 [Warning] CA certificate ca.pem is self signed.
2018-07-30T16:21:05.114984Z 0 [Note] Server hostname (bind-address): '127.0.0.1'; port: 3306
2018-07-30T16:21:05.115009Z 0 [Note]   - '127.0.0.1' resolves to '127.0.0.1';
2018-07-30T16:21:05.115029Z 0 [Note] Server socket created on IP: '127.0.0.1'.
2018-07-30T16:21:05.121314Z 0 [Note] Event Scheduler: Loaded 0 events
2018-07-30T16:21:05.122659Z 0 [Note] InnoDB: Buffer pool(s) load completed at 180731  0:21:05
2018-07-30T16:21:05.122807Z 0 [Note] /usr/sbin/mysqld: ready for connections.
Version: '5.7.22-0ubuntu0.16.04.1'  socket: '/var/run/mysqld/mysqld.sock'  port: 3306  (Ubuntu)
2018-07-30T16:21:05.661985Z 2 [Note] Access denied for user 'root'@'localhost' (using password: NO)

最佳答案

关于 my.cnf 或 my.ini [mysqld] 部分的建议

SELECT @@thread_cache_size;  # will give you current setting
SELECT @@innodb_buffer_pool_size;  # will give you current setting

将每个乘以 1.3 并设置为

SET GLOBAL thread_cache_size=<calculated-size>;  # use rounded UP whole numbers
SET GLOBAL innodb_buffer_pool_size=<calculated-size>;  

或者如果你有旧版本的 MySQL,你必须改变你的 my.cnf 或 my.ini,关机/重启。

请告诉我们进展如何。

如需其他帮助,请查看个人资料、网络个人资料、联系信息(包括 Skype ID)。谢谢

关于mysqldump 出错,在查询期间丢失与 MySQL 服务器的连接,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/51598583/

相关文章:

php - wordpress posts_orderby 过滤器与插件中的自定义表

php - 使用 codeigniter 在表中显示数据

mysql - Elasticsearch 6.5.4 中的 mapper_parsing_exception

mysql - DevArt MySQL 组件通过共享内存协议(protocol)连接到 MySQL

javascript - 数据表服务器端格式化链接

php - 错误 : undefined index?

mysql - Between 子句不起作用

php - Yii 上的 FindAll,字段名称无效

php - 无法安装 YOURLS (PHP 解析错误 : syntax error, 意外 ';' ,在 config.php 第 66 行预计 ')' )

php - 将 key$ 和 $value 插入数据库表单 foreach