昨日mysql崩溃,最后只能重装mysql 然后使用物理文件替换新的mysql的数据目录

2016-05-20 14:52:00
hainuo
原创 2022
摘要:The server quit without updating PID file
###The server quit without updating PID file如上 mysql停止后我使用命令`service mysqld start`然后就报这个错误。查看`mysql-error.log`文件发现如下日志```2016-05-19T11:17:11.320287Z mysqld_safe Starting mysqld daemon with databases from /data/mysql2016-05-19T11:17:11.440210Z 0 [Warning] Insecure configuration for --secure-file-priv: Current value does not restrict location of generated files. Consider setting it to a valid, non-empty path.2016-05-19T11:17:11.440326Z 0 [Note] /usr/local/mysql/bin/mysqld (mysqld 5.7.11-log) starting as process 22826 ...2016-05-19T11:17:11.440369Z 0 [Warning] Using pre 5.5 semantics to load error messages from /usr/share/mysql/.2016-05-19T11:17:11.440374Z 0 [Warning] If this is not intended, refer to the documentation for valid usage of --lc-messages-dir and --language parameters.2016-05-19T11:17:11.445625Z 0 [ERROR] Plugin keyring_file reported: 'keyring_file initialization failure. Please check if the keyring_file_data points to readable keyring file or keyring file can be created in the specified location. The keyring_file will stay unusable until correct path to the keyring file gets provided'2016-05-19T11:17:11.446320Z 0 [Note] InnoDB: PUNCH HOLE support available2016-05-19T11:17:11.446344Z 0 [Note] InnoDB: Mutexes and rw_locks use GCC atomic builtins2016-05-19T11:17:11.446354Z 0 [Note] InnoDB: Uses event mutexes2016-05-19T11:17:11.446364Z 0 [Note] InnoDB: GCC builtin __atomic_thread_fence() is used for memory barrier2016-05-19T11:17:11.446373Z 0 [Note] InnoDB: Compressed tables use zlib 1.2.32016-05-19T11:17:11.446382Z 0 [Note] InnoDB: Using Linux native AIO2016-05-19T11:17:11.447232Z 0 [Note] InnoDB: Number of pools: 12016-05-19T11:17:11.447396Z 0 [Note] InnoDB: Using CPU crc32 instructions2016-05-19T11:17:11.456798Z 0 [Note] InnoDB: Initializing buffer pool, total size = 128M, instances = 1, chunk size = 128M2016-05-19T11:17:11.465699Z 0 [Note] InnoDB: Completed initialization of buffer pool2016-05-19T11:17:11.468061Z 0 [Note] InnoDB: If the mysqld execution user is authorized, page cleaner thread priority can be changed. See the man page of setpriority().2016-05-19T11:17:11.480084Z 0 [Note] InnoDB: Highest supported file format is Barracuda.2016-05-19T11:17:11.496592Z 0 [Note] InnoDB: Creating shared tablespace for temporary tables2016-05-19T11:17:11.496683Z 0 [Note] InnoDB: Setting file './ibtmp1' size to 12 MB. Physically writing the file full; Please wait ...2016-05-19T11:17:11.785941Z 0 [Note] InnoDB: File './ibtmp1' size is now 12 MB.2016-05-19T11:17:11.786997Z 0 [Note] InnoDB: 96 redo rollback segment(s) found. 96 redo rollback segment(s) are active.2016-05-19T11:17:11.787013Z 0 [Note] InnoDB: 32 non-redo rollback segment(s) are active.2016-05-19T11:17:11.787822Z 0 [Note] InnoDB: Waiting for purge to start2016-05-19T11:17:11.837998Z 0 [Note] InnoDB: 5.7.11 started; log sequence number 32177112016-05-19T11:17:11.838775Z 0 [Note] InnoDB: Loading buffer pool(s) from /data/mysql/ib_buffer_pool2016-05-19T11:17:11.839022Z 0 [Note] Plugin 'FEDERATED' is disabled.2016-05-19T11:17:11.839052Z 0 [Note] InnoDB: Buffer pool(s) load completed at 160519 19:17:112016-05-19T11:17:11.839696Z 0 [ERROR] unknown variable 'key_buffer=16M'2016-05-19T11:17:11.839714Z 0 [ERROR] Aborting2016-05-19T11:17:11.839730Z 0 [Note] Binlog end2016-05-19T11:17:11.839811Z 0 [Note] Shutting down plugin 'ngram'2016-05-19T11:17:11.839823Z 0 [Note] Shutting down plugin 'BLACKHOLE'2016-05-19T11:17:11.839830Z 0 [Note] Shutting down plugin 'ARCHIVE'2016-05-19T11:17:11.839836Z 0 [Note] Shutting down plugin 'partition'2016-05-19T11:17:11.839841Z 0 [Note] Shutting down plugin 'CSV'2016-05-19T11:17:11.839847Z 0 [Note] Shutting down plugin 'MRG_MYISAM'2016-05-19T11:17:11.839854Z 0 [Note] Shutting down plugin 'MyISAM'2016-05-19T11:17:11.839869Z 0 [Note] Shutting down plugin 'MEMORY'2016-05-19T11:17:11.839877Z 0 [Note] Shutting down plugin 'PERFORMANCE_SCHEMA'2016-05-19T11:17:11.839946Z 0 [Note] Shutting down plugin 'INNODB_SYS_VIRTUAL'2016-05-19T11:17:11.839953Z 0 [Note] Shutting down plugin 'INNODB_SYS_DATAFILES'2016-05-19T11:17:11.839958Z 0 [Note] Shutting down plugin 'INNODB_SYS_TABLESPACES'2016-05-19T11:17:11.839964Z 0 [Note] Shutting down plugin 'INNODB_SYS_FOREIGN_COLS'2016-05-19T11:17:11.839985Z 0 [Note] Shutting down plugin 'INNODB_SYS_FOREIGN'2016-05-19T11:17:11.839991Z 0 [Note] Shutting down plugin 'INNODB_SYS_FIELDS'2016-05-19T11:17:11.839997Z 0 [Note] Shutting down plugin 'INNODB_SYS_COLUMNS'2016-05-19T11:17:11.840002Z 0 [Note] Shutting down plugin 'INNODB_SYS_INDEXES'2016-05-19T11:17:11.840007Z 0 [Note] Shutting down plugin 'INNODB_SYS_TABLESTATS'2016-05-19T11:17:11.840012Z 0 [Note] Shutting down plugin 'INNODB_SYS_TABLES'2016-05-19T11:17:11.840017Z 0 [Note] Shutting down plugin 'INNODB_FT_INDEX_TABLE'2016-05-19T11:17:11.840022Z 0 [Note] Shutting down plugin 'INNODB_FT_INDEX_CACHE'2016-05-19T11:17:11.840027Z 0 [Note] Shutting down plugin 'INNODB_FT_CONFIG'2016-05-19T11:17:11.840032Z 0 [Note] Shutting down plugin 'INNODB_FT_BEING_DELETED'2016-05-19T11:17:11.840037Z 0 [Note] Shutting down plugin 'INNODB_FT_DELETED'2016-05-19T11:17:11.840042Z 0 [Note] Shutting down plugin 'INNODB_FT_DEFAULT_STOPWORD'2016-05-19T11:17:11.840047Z 0 [Note] Shutting down plugin 'INNODB_METRICS'2016-05-19T11:17:11.840053Z 0 [Note] Shutting down plugin 'INNODB_TEMP_TABLE_INFO'2016-05-19T11:17:11.840058Z 0 [Note] Shutting down plugin 'INNODB_BUFFER_POOL_STATS'2016-05-19T11:17:11.840063Z 0 [Note] Shutting down plugin 'INNODB_BUFFER_PAGE_LRU'2016-05-19T11:17:11.840068Z 0 [Note] Shutting down plugin 'INNODB_BUFFER_PAGE'2016-05-19T11:17:11.840074Z 0 [Note] Shutting down plugin 'INNODB_CMP_PER_INDEX_RESET'2016-05-19T11:17:11.840080Z 0 [Note] Shutting down plugin 'INNODB_CMP_PER_INDEX'2016-05-19T11:17:11.840087Z 0 [Note] Shutting down plugin 'INNODB_CMPMEM_RESET'2016-05-19T11:17:11.840095Z 0 [Note] Shutting down plugin 'INNODB_CMPMEM'2016-05-19T11:17:11.840102Z 0 [Note] Shutting down plugin 'INNODB_CMP_RESET'2016-05-19T11:17:11.840107Z 0 [Note] Shutting down plugin 'INNODB_CMP'2016-05-19T11:17:11.840113Z 0 [Note] Shutting down plugin 'INNODB_LOCK_WAITS'2016-05-19T11:17:11.840118Z 0 [Note] Shutting down plugin 'INNODB_LOCKS'2016-05-19T11:17:11.840123Z 0 [Note] Shutting down plugin 'INNODB_TRX'2016-05-19T11:17:11.840128Z 0 [Note] Shutting down plugin 'InnoDB'2016-05-19T11:17:11.840177Z 0 [Note] InnoDB: FTS optimize thread exiting.2016-05-19T11:17:11.840236Z 0 [Note] InnoDB: Starting shutdown...2016-05-19T11:17:11.940500Z 0 [Note] InnoDB: Dumping buffer pool(s) to /data/mysql/ib_buffer_pool2016-05-19T11:17:11.940720Z 0 [Note] InnoDB: Buffer pool(s) dump completed at 160519 19:17:112016-05-19T11:17:13.658844Z 0 [Note] InnoDB: Shutdown completed; log sequence number 32177302016-05-19T11:17:13.660996Z 0 [Note] InnoDB: Removed temporary tablespace data file: "ibtmp1"2016-05-19T11:17:13.661013Z 0 [Note] Shutting down plugin 'sha256_password'2016-05-19T11:17:13.661018Z 0 [Note] Shutting down plugin 'mysql_native_password'2016-05-19T11:17:13.661022Z 0 [Note] Shutting down plugin 'keyring_file'2016-05-19T11:17:13.661239Z 0 [Note] Shutting down plugin 'binlog'2016-05-19T11:17:13.661545Z 0 [Note] /usr/local/mysql/bin/mysqld: Shutdown complete2016-05-19T11:17:13.665486Z mysqld_safe mysqld from pid file /data/mysql/mysql.pid ended2016-05-19T11:21:40.982056Z mysqld_safe Starting mysqld daemon with databases from /data/mysql2016-05-19T11:21:41.120422Z 0 [Warning] Insecure configuration for --secure-file-priv: Current value does not restrict location of generated files. Consider setting it to a valid, non-empty path.2016-05-19T11:21:41.120540Z 0 [Note] /usr/local/mysql/bin/mysqld (mysqld 5.7.11-log) starting as process 2013 ...2016-05-19T11:21:41.124676Z 0 [Warning] Using pre 5.5 semantics to load error messages from /usr/share/mysql/.2016-05-19T11:21:41.124689Z 0 [Warning] If this is not intended, refer to the documentation for valid usage of --lc-messages-dir and --language parameters.2016-05-19T11:21:41.153705Z 0 [ERROR] Plugin keyring_file reported: 'keyring_file initialization failure. Please check if the keyring_file_data points to readable keyring file or keyring file can be created in the specified location. The keyring_file will stay unusable until correct path to the keyring file gets provided'2016-05-19T11:21:41.154263Z 0 [Note] InnoDB: PUNCH HOLE support available2016-05-19T11:21:41.154281Z 0 [Note] InnoDB: Mutexes and rw_locks use GCC atomic builtins2016-05-19T11:21:41.154289Z 0 [Note] InnoDB: Uses event mutexes2016-05-19T11:21:41.154295Z 0 [Note] InnoDB: GCC builtin __atomic_thread_fence() is used for memory barrier2016-05-19T11:21:41.154301Z 0 [Note] InnoDB: Compressed tables use zlib 1.2.32016-05-19T11:21:41.154308Z 0 [Note] InnoDB: Using Linux native AIO2016-05-19T11:21:41.154934Z 0 [Note] InnoDB: Number of pools: 12016-05-19T11:21:41.155061Z 0 [Note] InnoDB: Using CPU crc32 instructions2016-05-19T11:21:41.163862Z 0 [Note] InnoDB: Initializing buffer pool, total size = 128M, instances = 1, chunk size = 128M2016-05-19T11:21:41.172518Z 0 [Note] InnoDB: Completed initialization of buffer pool2016-05-19T11:21:41.175602Z 0 [Note] InnoDB: If the mysqld execution user is authorized, page cleaner thread priority can be changed. See the man page of setpriority().2016-05-19T11:21:41.254418Z 0 [Note] InnoDB: Highest supported file format is Barracuda.2016-05-19T11:21:41.417277Z 0 [Note] InnoDB: Creating shared tablespace for temporary tables2016-05-19T11:21:41.417364Z 0 [Note] InnoDB: Setting file './ibtmp1' size to 12 MB. Physically writing the file full; Please wait ...2016-05-19T11:21:41.730662Z 0 [Note] InnoDB: File './ibtmp1' size is now 12 MB.2016-05-19T11:21:41.731718Z 0 [Note] InnoDB: 96 redo rollback segment(s) found. 96 redo rollback segment(s) are active.2016-05-19T11:21:41.731733Z 0 [Note] InnoDB: 32 non-redo rollback segment(s) are active.2016-05-19T11:21:41.732171Z 0 [Note] InnoDB: Waiting for purge to start2016-05-19T11:21:41.782402Z 0 [Note] InnoDB: 5.7.11 started; log sequence number 32177302016-05-19T11:21:41.783134Z 0 [Note] InnoDB: Loading buffer pool(s) from /data/mysql/ib_buffer_pool2016-05-19T11:21:41.783392Z 0 [Note] Plugin 'FEDERATED' is disabled.2016-05-19T11:21:41.833965Z 0 [ERROR] unknown variable 'key_buffer=16M'2016-05-19T11:21:41.834002Z 0 [ERROR] Aborting2016-05-19T11:21:41.834015Z 0 [Note] Binlog end2016-05-19T11:21:41.834110Z 0 [Note] Shutting down plugin 'ngram'2016-05-19T11:21:41.834122Z 0 [Note] Shutting down plugin 'BLACKHOLE'2016-05-19T11:21:41.834127Z 0 [Note] Shutting down plugin 'ARCHIVE'2016-05-19T11:21:41.834131Z 0 [Note] Shutting down plugin 'partition'2016-05-19T11:21:41.834136Z 0 [Note] Shutting down plugin 'CSV'2016-05-19T11:21:41.834140Z 0 [Note] Shutting down plugin 'MRG_MYISAM'2016-05-19T11:21:41.834146Z 0 [Note] Shutting down plugin 'MyISAM'2016-05-19T11:21:41.834159Z 0 [Note] Shutting down plugin 'MEMORY'2016-05-19T11:21:41.834165Z 0 [Note] Shutting down plugin 'PERFORMANCE_SCHEMA'2016-05-19T11:21:41.834212Z 0 [Note] Shutting down plugin 'INNODB_SYS_VIRTUAL'2016-05-19T11:21:41.834217Z 0 [Note] Shutting down plugin 'INNODB_SYS_DATAFILES'2016-05-19T11:21:41.834222Z 0 [Note] Shutting down plugin 'INNODB_SYS_TABLESPACES'2016-05-19T11:21:41.834226Z 0 [Note] Shutting down plugin 'INNODB_SYS_FOREIGN_COLS'2016-05-19T11:21:41.834229Z 0 [Note] Shutting down plugin 'INNODB_SYS_FOREIGN'2016-05-19T11:21:41.834234Z 0 [Note] Shutting down plugin 'INNODB_SYS_FIELDS'2016-05-19T11:21:41.834238Z 0 [Note] Shutting down plugin 'INNODB_SYS_COLUMNS'2016-05-19T11:21:41.834241Z 0 [Note] Shutting down plugin 'INNODB_SYS_INDEXES'2016-05-19T11:21:41.834245Z 0 [Note] Shutting down plugin 'INNODB_SYS_TABLESTATS'2016-05-19T11:21:41.834249Z 0 [Note] Shutting down plugin 'INNODB_SYS_TABLES'2016-05-19T11:21:41.834253Z 0 [Note] Shutting down plugin 'INNODB_FT_INDEX_TABLE'2016-05-19T11:21:41.834257Z 0 [Note] Shutting down plugin 'INNODB_FT_INDEX_CACHE'2016-05-19T11:21:41.834261Z 0 [Note] Shutting down plugin 'INNODB_FT_CONFIG'2016-05-19T11:21:41.834265Z 0 [Note] Shutting down plugin 'INNODB_FT_BEING_DELETED'2016-05-19T11:21:41.834269Z 0 [Note] Shutting down plugin 'INNODB_FT_DELETED'2016-05-19T11:21:41.834272Z 0 [Note] Shutting down plugin 'INNODB_FT_DEFAULT_STOPWORD'2016-05-19T11:21:41.834276Z 0 [Note] Shutting down plugin 'INNODB_METRICS'2016-05-19T11:21:41.834291Z 0 [Note] Shutting down plugin 'INNODB_TEMP_TABLE_INFO'2016-05-19T11:21:41.834296Z 0 [Note] Shutting down plugin 'INNODB_BUFFER_POOL_STATS'2016-05-19T11:21:41.834300Z 0 [Note] Shutting down plugin 'INNODB_BUFFER_PAGE_LRU'2016-05-19T11:21:41.834303Z 0 [Note] Shutting down plugin 'INNODB_BUFFER_PAGE'2016-05-19T11:21:41.834307Z 0 [Note] Shutting down plugin 'INNODB_CMP_PER_INDEX_RESET'2016-05-19T11:21:41.834311Z 0 [Note] Shutting down plugin 'INNODB_CMP_PER_INDEX'2016-05-19T11:21:41.834314Z 0 [Note] Shutting down plugin 'INNODB_CMPMEM_RESET'2016-05-19T11:21:41.834318Z 0 [Note] Shutting down plugin 'INNODB_CMPMEM'2016-05-19T11:21:41.834322Z 0 [Note] Shutting down plugin 'INNODB_CMP_RESET'2016-05-19T11:21:41.834326Z 0 [Note] Shutting down plugin 'INNODB_CMP'2016-05-19T11:21:41.834329Z 0 [Note] Shutting down plugin 'INNODB_LOCK_WAITS'2016-05-19T11:21:41.834333Z 0 [Note] Shutting down plugin 'INNODB_LOCKS'2016-05-19T11:21:41.834337Z 0 [Note] Shutting down plugin 'INNODB_TRX'2016-05-19T11:21:41.834340Z 0 [Note] Shutting down plugin 'InnoDB'2016-05-19T11:21:41.834391Z 0 [Note] InnoDB: FTS optimize thread exiting.2016-05-19T11:21:41.834528Z 0 [Note] InnoDB: Starting shutdown...2016-05-19T11:21:41.834926Z 0 [Note] InnoDB: Buffer pool(s) load completed at 160519 19:21:412016-05-19T11:21:41.834958Z 0 [Note] InnoDB: Dumping buffer pool(s) to /data/mysql/ib_buffer_pool2016-05-19T11:21:41.839436Z 0 [Note] InnoDB: Buffer pool(s) dump completed at 160519 19:21:412016-05-19T11:21:43.353977Z 0 [Note] InnoDB: Shutdown completed; log sequence number 32177492016-05-19T11:21:43.356107Z 0 [Note] InnoDB: Removed temporary tablespace data file: "ibtmp1"2016-05-19T11:21:43.356124Z 0 [Note] Shutting down plugin 'sha256_password'2016-05-19T11:21:43.356130Z 0 [Note] Shutting down plugin 'mysql_native_password'2016-05-19T11:21:43.356135Z 0 [Note] Shutting down plugin 'keyring_file'2016-05-19T11:21:43.356358Z 0 [Note] Shutting down plugin 'binlog'2016-05-19T11:21:43.356594Z 0 [Note] /usr/local/mysql/bin/mysqld: Shutdown complete2016-05-19T11:21:43.360585Z mysqld_safe mysqld from pid file /data/mysql/mysql.pid ended```通过这个也看不到什么问题,因为那个`msg`和`keyring`都是可以不用的,可以排除这个问题最后只能是卸载`mysql`,然后重新安装`mysql` 然后停止服务`service mysqld stop` 将数据存储目录替换为原先的存储目录 修改原先存储目录的权限`chown mysql:mysql /data/mysql` 然后再启动服务`service mysqld start` OK 成功分析原因 可能是因为某些问题mysql 数据出现bug导致自动abort
发表评论
肆 减 壹 =
评论通过审核后显示。