No connection. Trying to reconnect... ERROR 2002 (HY000): Can't connect to local MySQL server throug

操作:新搭建了一个数据库备份库,把dump的数据导入备份库

1、
第一次启动,mysql没有报错,正常启动
在执行source  table——name.sql 时,中间时而出现以下错误
No connection. Trying to reconnect...
ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/tmp/mysql.sock' (2)
ERROR:
Can't connect to the server
最终导致服务器挂掉
2、
尝试启动mysql服务器,error日志里报错
一直卡在83
2018-01-19 21:27:27 11847 [Warning] Using unique option prefix myisam-recover instead of myisam-recover-options is deprecated and will be removed in a future release. Please use the full name instead.
2018-01-19 21:27:27 11847 [Note] Plugin 'FEDERATED' is disabled.
2018-01-19 21:27:27 11847 [Note] InnoDB: Using atomics to ref count buffer pool pages
2018-01-19 21:27:27 11847 [Note] InnoDB: The InnoDB memory heap is disabled
2018-01-19 21:27:27 11847 [Note] InnoDB: Mutexes and rw_locks use GCC atomic builtins
2018-01-19 21:27:27 11847 [Note] InnoDB: Memory barrier is not used
2018-01-19 21:27:27 11847 [Note] InnoDB: Compressed tables use zlib 1.2.7
2018-01-19 21:27:27 11847 [Note] InnoDB: Using Linux native AIO
2018-01-19 21:27:27 11847 [Note] InnoDB: Using CPU crc32 instructions
2018-01-19 21:27:27 11847 [Note] InnoDB: Initializing buffer pool, size = 10.0G
2018-01-19 21:27:27 11847 [Note] InnoDB: Completed initialization of buffer pool
2018-01-19 21:27:27 11847 [Note] InnoDB: Highest supported file format is Barracuda.
2018-01-19 21:27:27 11847 [Note] InnoDB: Log scan progressed past the checkpoint lsn 25973046597
2018-01-19 21:27:27 11847 [Note] InnoDB: Database was not shutdown normally!
2018-01-19 21:27:27 11847 [Note] InnoDB: Starting crash recovery.
2018-01-19 21:27:27 11847 [Note] InnoDB: Reading tablespace information from the .ibd files...
2018-01-19 21:27:27 11847 [Note] InnoDB: Restoring possible half-written data pages
2018-01-19 21:27:27 11847 [Note] InnoDB: from the doublewrite buffer...
InnoDB: Doing recovery: scanned up to log sequence number 25978289152
InnoDB: Doing recovery: scanned up to log sequence number 25983532032
InnoDB: Doing recovery: scanned up to log sequence number 25988774912
InnoDB: Doing recovery: scanned up to log sequence number 25994017792
..........
..........
InnoDB: Doing recovery: scanned up to log sequence number 26617920512
InnoDB: Doing recovery: scanned up to log sequence number 26622305501
2018-01-19 21:27:33 11847 [Note] InnoDB: Starting an apply batch of log records to the database...
InnoDB: Progress in percent: 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83
看到“InnoDB: Doing recovery”以为是异常宕机正在恢复数据呢,等了一段时间之后发现不对劲。这次数据完全起、启动不了。

排查问题:
因为my.cnf 是从主库copy下来的,对比了my.nf文件之后发现:
innodb_buffer_pool_size 的值10G 而服务器才3G  ,数据库的buffer大于服务器内存总大小
修改之后,mysql正常启动

你可能感兴趣的:(MySQL)