zoukankan      html  css  js  c++  java
  • mysql-The-server-quit-without-updating-PID-file

    mysql 编译后执行 /etc/init.d/mysqld start 启动失败 提示:"The server quit without updating PID file"

    排查思路: 寻找配置文件 --》寻找错误日志 --》 根据日志排查错误

     grep -i log /etc/my.cnf 
    log-error=/var/log/mariadb/mariadb.log
    log-error=/var/log/mysqld.log

    找到日志目录:/var/log/mariadb/mariadb.log 

     0 [Warning] TIMESTAMP with implicit DEFAULT value is deprecated. Please use --explicit_defaults_for_timestamp server option (see documentation for more details).
    2018-10-31T01:46:26.095643Z 0 [Note] --secure-file-priv is set to NULL. Operations related to importing and exporting data are disabled
    2018-10-31T01:46:26.095673Z 0 [Note] /usr/local/mysql/bin/mysqld (mysqld 5.7.20) starting as process 13840 ...
    2018-10-31T01:46:26.101854Z 0 [Note] InnoDB: PUNCH HOLE support available
    2018-10-31T01:46:26.101889Z 0 [Note] InnoDB: Mutexes and rw_locks use GCC atomic builtins
    2018-10-31T01:46:26.101894Z 0 [Note] InnoDB: Uses event mutexes
    2018-10-31T01:46:26.101898Z 0 [Note] InnoDB: GCC builtin __sync_synchronize() is used for memory barrier
    2018-10-31T01:46:26.101901Z 0 [Note] InnoDB: Compressed tables use zlib 1.2.3
    2018-10-31T01:46:26.101905Z 0 [Note] InnoDB: Using Linux native AIO
    2018-10-31T01:46:26.102226Z 0 [Note] InnoDB: Number of pools: 1
    2018-10-31T01:46:26.102358Z 0 [Note] InnoDB: Not using CPU crc32 instructions
    2018-10-31T01:46:26.114227Z 0 [Note] InnoDB: Initializing buffer pool, total size = 128M, instances = 1, chunk size = 128M
    2018-10-31T01:46:26.125607Z 0 [Note] InnoDB: Completed initialization of buffer pool
    2018-10-31T01:46:26.130780Z 0 [Note] InnoDB: If the mysqld execution user is authorized, page cleaner thread priority can be changed. See the man page of setpriority().
    2018-10-31T01:46:26.143294Z 0 [Note] InnoDB: Highest supported file format is Barracuda.
    2018-10-31T01:46:26.157636Z 0 [Note] InnoDB: Creating shared tablespace for temporary tables
    2018-10-31T01:46:26.157698Z 0 [Note] InnoDB: Setting file './ibtmp1' size to 12 MB. Physically writing the file full; Please wait ...
    2018-10-31T01:46:26.373856Z 0 [Note] InnoDB: File './ibtmp1' size is now 12 MB.
    2018-10-31T01:46:26.375220Z 0 [Note] InnoDB: 96 redo rollback segment(s) found. 96 redo rollback segment(s) are active.
    2018-10-31T01:46:26.375236Z 0 [Note] InnoDB: 32 non-redo rollback segment(s) are active.
    2018-10-31T01:46:26.377128Z 0 [Note] InnoDB: 5.7.20 started; log sequence number 1209980
    2018-10-31T01:46:26.377614Z 0 [Note] InnoDB: Loading buffer pool(s) from /usr/local/mysql/data/ib_buffer_pool
    2018-10-31T01:46:26.377957Z 0 [Note] Plugin 'FEDERATED' is disabled.
    mysqld: Table 'mysql.plugin' doesn't exist
    2018-10-31T01:46:26.378127Z 0 [ERROR] Can't open the mysql.plugin table. Please run mysql_upgrade to create it.
    2018-10-31T01:46:26.378944Z 0 [Warning] Gtid table is not ready to be used. Table 'mysql.gtid_executed' cannot be opened.
    2018-10-31T01:46:26.379048Z 0 [Warning] Failed to set up SSL because of the following SSL library error: SSL context is not usable without certificate and private key
    2018-10-31T01:46:26.379266Z 0 [Note] InnoDB: Buffer pool(s) load completed at 181031  9:46:26
    2018-10-31T01:46:26.379458Z 0 [Note] Server hostname (bind-address): '*'; port: 3306
    2018-10-31T01:46:26.379507Z 0 [Note] IPv6 is available.
    2018-10-31T01:46:26.379518Z 0 [Note]   - '::' resolves to '::';
    2018-10-31T01:46:26.379544Z 0 [Note] Server socket created on IP: '::'.
    2018-10-31T01:46:26.387876Z 0 [Warning] Failed to open optimizer cost constant tables
    
    2018-10-31T01:46:26.388087Z 0 [ERROR] Fatal error: Can't open and lock privilege tables: Table 'mysql.user' doesn't exist
    2018-10-31T01:46:26.388146Z 0 [ERROR] Aborting
    
    2018-10-31T01:46:26.388181Z 0 [Note] Binlog end
    2018-10-31T01:46:26.388229Z 0 [Note] Shutting down plugin 'ngram'
    2018-10-31T01:46:26.388237Z 0 [Note] Shutting down plugin 'BLACKHOLE'
    2018-10-31T01:46:26.388241Z 0 [Note] Shutting down plugin 'partition'
    2018-10-31T01:46:26.388243Z 0 [Note] Shutting down plugin 'ARCHIVE'
    2018-10-31T01:46:26.388246Z 0 [Note] Shutting down plugin 'MyISAM'
    2018-10-31T01:46:26.388257Z 0 [Note] Shutting down plugin 'CSV'
    2018-10-31T01:46:26.388261Z 0 [Note] Shutting down plugin 'INNODB_SYS_VIRTUAL'
    2018-10-31T01:46:26.388264Z 0 [Note] Shutting down plugin 'INNODB_SYS_DATAFILES'
    2018-10-31T01:46:26.388267Z 0 [Note] Shutting down plugin 'INNODB_SYS_TABLESPACES'
    2018-10-31T01:46:26.388269Z 0 [Note] Shutting down plugin 'INNODB_SYS_FOREIGN_COLS'
    2018-10-31T01:46:26.388282Z 0 [Note] Shutting down plugin 'INNODB_SYS_FOREIGN'
    2018-10-31T01:46:26.388284Z 0 [Note] Shutting down plugin 'INNODB_SYS_FIELDS'
    2018-10-31T01:46:26.388286Z 0 [Note] Shutting down plugin 'INNODB_SYS_COLUMNS'
    2018-10-31T01:46:26.388289Z 0 [Note] Shutting down plugin 'INNODB_SYS_INDEXES'
    2018-10-31T01:46:26.388291Z 0 [Note] Shutting down plugin 'INNODB_SYS_TABLESTATS'
    2018-10-31T01:46:26.388293Z 0 [Note] Shutting down plugin 'INNODB_SYS_TABLES'
    2018-10-31T01:46:26.388295Z 0 [Note] Shutting down plugin 'INNODB_FT_INDEX_TABLE'
    2018-10-31T01:46:26.388298Z 0 [Note] Shutting down plugin 'INNODB_FT_INDEX_CACHE'
    2018-10-31T01:46:26.388300Z 0 [Note] Shutting down plugin 'INNODB_FT_CONFIG'
    2018-10-31T01:46:26.388302Z 0 [Note] Shutting down plugin 'INNODB_FT_BEING_DELETED'
    2018-10-31T01:46:26.388304Z 0 [Note] Shutting down plugin 'INNODB_FT_DELETED'
    2018-10-31T01:46:26.388307Z 0 [Note] Shutting down plugin 'INNODB_FT_DEFAULT_STOPWORD'
    2018-10-31T01:46:26.388309Z 0 [Note] Shutting down plugin 'INNODB_METRICS'
    2018-10-31T01:46:26.388311Z 0 [Note] Shutting down plugin 'INNODB_TEMP_TABLE_INFO'
    2018-10-31T01:46:26.388313Z 0 [Note] Shutting down plugin 'INNODB_BUFFER_POOL_STATS'
    2018-10-31T01:46:26.388316Z 0 [Note] Shutting down plugin 'INNODB_BUFFER_PAGE_LRU'
    2018-10-31T01:46:26.388318Z 0 [Note] Shutting down plugin 'INNODB_BUFFER_PAGE'
    2018-10-31T01:46:26.388320Z 0 [Note] Shutting down plugin 'INNODB_CMP_PER_INDEX_RESET'
    2018-10-31T01:46:26.388322Z 0 [Note] Shutting down plugin 'INNODB_CMP_PER_INDEX'
    2018-10-31T01:46:26.388325Z 0 [Note] Shutting down plugin 'INNODB_CMPMEM_RESET'
    2018-10-31T01:46:26.388327Z 0 [Note] Shutting down plugin 'INNODB_CMPMEM'
    2018-10-31T01:46:26.388329Z 0 [Note] Shutting down plugin 'INNODB_CMP_RESET'
    2018-10-31T01:46:26.388332Z 0 [Note] Shutting down plugin 'INNODB_CMP'
    2018-10-31T01:46:26.388334Z 0 [Note] Shutting down plugin 'INNODB_LOCK_WAITS'
    2018-10-31T01:46:26.388336Z 0 [Note] Shutting down plugin 'INNODB_LOCKS'
    2018-10-31T01:46:26.388338Z 0 [Note] Shutting down plugin 'INNODB_TRX'
    2018-10-31T01:46:26.388341Z 0 [Note] Shutting down plugin 'InnoDB'
    2018-10-31T01:46:26.388441Z 0 [Note] InnoDB: FTS optimize thread exiting.
    2018-10-31T01:46:26.388685Z 0 [Note] InnoDB: Starting shutdown...
    2018-10-31T01:46:26.489041Z 0 [Note] InnoDB: Dumping buffer pool(s) to /usr/local/mysql/data/ib_buffer_pool

    根据日志提示判断问题所在:

    重新初始化db:进入安装目录  /usr/local/mysql/

    ./bin/mysql_install_db  --user=mysql --basedir=/usr/local/mysql   --datadir=/usr/local/mysql/data   

    提示找不到mysql 命令可先链接 

    ln -s /usr/local/mysql/bin/mysql  /usr/bin/

     /usr/local/mysql/
  • 相关阅读:
    VirtualBox下Linux扩展磁盘空间
    idea 2019.3 svn 忽略文件/目录
    CentOS7添加/删除用户和用户组
    查看LINUX进程内存占用情况及启动时间
    Linux定时自动备份oracle数据库
    oracle11g数据库导入导出方法教程以及导出表不全解决
    ubuntu12下安装unixODBC(mysql)
    oracle登录管理员创建数据库和表空间
    centos7 64运行32位程序
    Windows下搭建Redis集群
  • 原文地址:https://www.cnblogs.com/lavin/p/mysql-The-server-quit-without-updating-PID-file.html
Copyright © 2011-2022 走看看