MySQL启动报错:Starting MySQL.. ERROR! The server quit without updating PID file的问题分析和解决

 更新时间:2023年12月07日 11:30:23   作者:清风的BLOG  
这篇文章给大家介绍了MySQL启动报错:Starting MySQL.. ERROR! The server quit without updating PID file的问题分析和解决办法,文中给出了详细的原因分析,需要的朋友可以参考下

问题

[root@centos74 ~]# service mysqld start
Starting MySQL.. ERROR! The server quit without updating PID file (/usr/local/mysql/data/mysqld.pid).

分析解决

1、 可能已经存在 mysqld 进程.

[root@centos74 ~]# ps -ef | grep mysqld
 
[root@centos74 ~]# pkill -9 mysqld
 
# 查看是否有这个进程,如果有杀死掉

2、数据目录mysql用户是否有权限.

[root@centos74 ~]# chown -R mysql.mysql /usr/local/mysql/data

3、机器上面还有上次安装mysql的残留.

[root@centos74 ~]# find / -name mysql-binlog*
 
# 查看mysql的二进制目录,看是否存在mysqlbinlog.index,有的话删掉

4、mysql 在启动的时候会去寻找默认的 配置文件 /etc/my.cnf  这个目录下的 datadir 要指定数据目录.

 
# 如果没有,那么在 my.cnf 里面添加 datadir=/usr/local/mysql/data  

5、skip-federated字段问题.

# 检查一下/etc/my.cnf文件中有没有没被注释掉的skip-federated字段,如果有就立即注释掉.

6、错误日志目录不存在.

# 赋予 mysql 所有者权限 chmod  chown .

7、防火墙原因.

# centos 会默认开启selinux .
 
[root@centos74 ~]# vim /etc/selinux/config
SELINUX=disabled

8、查看配置文件/usr/local/mysql/my.cnf里有没有innodb_buffer_pool_size

# innodb_buffer_pool_size:主要作用是缓存innodb表的索引,数据,插入数据时的缓冲.
 
# 默认值:128M;
 
# 专用mysql服务器设置此值的大小: 系统内存的70%-80%最佳.
 
# 如果你的系统内存不大,查看这个参数,把它的值设置小一点.

10、关注 mysql 的报错日志.

[root@centos74 /]# cd /usr/local/mysql/
[root@centos74 mysql]# cat mysql.err 
 
190718  8:31:56 [Note] Plugin 'FEDERATED' is disabled.
mysqld: Table 'mysql.plugin' doesn't exist
190718  8:31:56 [ERROR] Can't open the mysql.plugin table. Please run mysql_upgrade to create it.
190718  8:31:56 InnoDB: The InnoDB memory heap is disabled
190718  8:31:56 InnoDB: Mutexes and rw_locks use GCC atomic builtins
190718  8:31:56 InnoDB: Compressed tables use zlib 1.2.11
190718  8:31:56 InnoDB: Using Linux native AIO
190718  8:31:56 InnoDB: Initializing buffer pool, size = 128.0M
190718  8:31:56 InnoDB: Completed initialization of buffer pool
InnoDB: The first specified data file ./ibdata1 did not exist:
InnoDB: a new database to be created!
190718  8:31:56  InnoDB: Setting file ./ibdata1 size to 10 MB
InnoDB: Database physically writes the file full: wait...
190718  8:31:56  InnoDB: Log file ./ib_logfile0 did not exist: new to be created
InnoDB: Setting log file ./ib_logfile0 size to 5 MB
InnoDB: Database physically writes the file full: wait...
190718  8:31:56  InnoDB: Log file ./ib_logfile1 did not exist: new to be created
InnoDB: Setting log file ./ib_logfile1 size to 5 MB
InnoDB: Database physically writes the file full: wait...
InnoDB: Doublewrite buffer not found: creating new
InnoDB: Doublewrite buffer created
InnoDB: 127 rollback segment(s) active.
InnoDB: Creating foreign key constraint system tables
InnoDB: Foreign key constraint system tables created
190718  8:31:56  InnoDB: Waiting for the background threads to start
190718  8:31:57 InnoDB: 5.5.62 started; log sequence number 0
190718  8:31:57 [ERROR] mysqld: unknown option '--initialize'
190718  8:31:57 [ERROR] Aborting
 
190718  8:31:57  InnoDB: Starting shutdown...
190718  8:31:58  InnoDB: Shutdown completed; log sequence number 1595675
190718  8:31:58 [Note] mysqld: Shutdown complete
 
190718  8:32:07 [Note] Plugin 'FEDERATED' is disabled.
/usr/local/mysql/bin/mysqld: Table 'mysql.plugin' doesn't exist
190718  8:32:07 [ERROR] Can't open the mysql.plugin table. Please run mysql_upgrade to create it.
190718  8:32:07 InnoDB: The InnoDB memory heap is disabled
190718  8:32:07 InnoDB: Mutexes and rw_locks use GCC atomic builtins
190718  8:32:07 InnoDB: Compressed tables use zlib 1.2.11
190718  8:32:07 InnoDB: Using Linux native AIO
190718  8:32:07 InnoDB: Initializing buffer pool, size = 128.0M
190718  8:32:07 InnoDB: Completed initialization of buffer pool
190718  8:32:07 InnoDB: highest supported file format is Barracuda.
190718  8:32:07  InnoDB: Waiting for the background threads to start
190718  8:32:08 InnoDB: 5.5.62 started; log sequence number 1595675
190718  8:32:08 [Note] Server hostname (bind-address): '0.0.0.0'; port: 3306
190718  8:32:08 [Note]   - '0.0.0.0' resolves to '0.0.0.0';
190718  8:32:08 [Note] Server socket created on IP: '0.0.0.0'.
190718  8:32:08 [ERROR] Fatal error: Can't open and lock privilege tables: Table 'mysql.host' doesn't exist
190718  8:33:17 [Note] Plugin 'FEDERATED' is disabled.
/usr/local/mysql/bin/mysqld: Table 'mysql.plugin' doesn't exist
190718  8:33:17 [ERROR] Can't open the mysql.plugin table. Please run mysql_upgrade to create it.
190718  8:33:17 InnoDB: The InnoDB memory heap is disabled
190718  8:33:17 InnoDB: Mutexes and rw_locks use GCC atomic builtins
190718  8:33:17 InnoDB: Compressed tables use zlib 1.2.11
190718  8:33:17 InnoDB: Using Linux native AIO
190718  8:33:17 InnoDB: Initializing buffer pool, size = 128.0M
190718  8:33:17 InnoDB: Completed initialization of buffer pool
190718  8:33:17 InnoDB: highest supported file format is Barracuda.
190718  8:33:17  InnoDB: Waiting for the background threads to start
190718  8:33:18 InnoDB: 5.5.62 started; log sequence number 1595675
190718  8:33:18 [Note] Server hostname (bind-address): '0.0.0.0'; port: 3306
190718  8:33:18 [Note]   - '0.0.0.0' resolves to '0.0.0.0';
190718  8:33:18 [Note] Server socket created on IP: '0.0.0.0'.
190718  8:33:18 [ERROR] Fatal error: Can't open and lock privilege tables: Table 'mysql.host' doesn't exist
190718  8:36:58 [Note] Plugin 'FEDERATED' is disabled.
/usr/local/mysql/bin/mysqld: Table 'mysql.plugin' doesn't exist
190718  8:36:58 [ERROR] Can't open the mysql.plugin table. Please run mysql_upgrade to create it.
190718  8:36:58 InnoDB: The InnoDB memory heap is disabled
190718  8:36:58 InnoDB: Mutexes and rw_locks use GCC atomic builtins
190718  8:36:58 InnoDB: Compressed tables use zlib 1.2.11
190718  8:36:58 InnoDB: Using Linux native AIO
190718  8:36:58 InnoDB: Initializing buffer pool, size = 128.0M
190718  8:36:58 InnoDB: Completed initialization of buffer pool
190718  8:36:58 InnoDB: highest supported file format is Barracuda.
190718  8:36:58  InnoDB: Waiting for the background threads to start
190718  8:36:59 InnoDB: 5.5.62 started; log sequence number 1595675
190718  8:36:59 [Note] Server hostname (bind-address): '0.0.0.0'; port: 3306
190718  8:36:59 [Note]   - '0.0.0.0' resolves to '0.0.0.0';
190718  8:36:59 [Note] Server socket created on IP: '0.0.0.0'.
190718  8:36:59 [ERROR] Fatal error: Can't open and lock privilege tables: Table 'mysql.host' doesn't exist

以上就是MySQL启动报错:Starting MySQL.. ERROR! The server quit without updating PID file的问题分析和解决的详细内容,更多关于MySQL启动报错:Starting MySQL.. ERROR的资料请关注脚本之家其它相关文章!

相关文章

  • 修改mysql密码与忘记mysql密码的处理方法

    修改mysql密码与忘记mysql密码的处理方法

    修改mysql密码与忘记mysql密码的处理方法,有需要的朋友可以参考下
    2013-02-02
  • MYSQL半同步配置思路

    MYSQL半同步配置思路

    在默认设置下,MySQL使用异步复制,主库发送binlog后不等待从库确认,可能导致数据不一致或丢失,半同步复制则在主库更新数据后先等待从库确认同步完成,本文给大家介绍MYSQL半同步配置,感兴趣的朋友一起看看吧
    2023-09-09
  • 一句命令完成MySQL的数据迁移(轻量级数据)

    一句命令完成MySQL的数据迁移(轻量级数据)

    有时候我们需要将数据库迁移的本地,对于数据量不大的数据完全可以采用下面的命令实现,如果数据量比较大,建议使用专业的工具,例如帝国备份王等
    2013-08-08
  • MySQL之范式的使用详解

    MySQL之范式的使用详解

    这篇文章主要介绍了MySQL之范式的使用详解,文中通过示例代码介绍的非常详细,对大家的学习或者工作具有一定的参考学习价值,需要的朋友们下面随着小编来一起学习学习吧
    2020-10-10
  • MySQL使用show effective grants查看权限官方解读

    MySQL使用show effective grants查看权限官方解读

    这篇文章主要为大家介绍了MySQL使用show effective grants查看权限,有需要的朋友可以借鉴参考下,希望能够有所帮助,祝大家多多进步,早日升职加薪
    2023-07-07
  • 利用phpmyadmin设置mysql的权限方法

    利用phpmyadmin设置mysql的权限方法

    这篇文章主要介绍了如何利用phpmyadmin设置mysql的权限方法,需要的朋友可以参考下
    2018-03-03
  • 浅谈慢SQL优化之索引的作用

    浅谈慢SQL优化之索引的作用

    本文针对 MySQL 数据库的 InnoDB 存储引擎,介绍其中索引的实现以及索引在慢 SQL 优化中的作用,本文主要讨论不同场景下索引生效与失效的原因,感兴趣的小伙伴可以跟着小编一起来探讨
    2023-05-05
  • 使用Python的Django框架中的压缩组件Django Compressor

    使用Python的Django框架中的压缩组件Django Compressor

    这篇文章主要介绍了使用Python的Django框架中的压缩组件Django Compressor,这个工具主要用于实现js/css的压缩,需要的朋友可以参考下
    2015-05-05
  • 关于mysql 8.0.13zip包安装方法

    关于mysql 8.0.13zip包安装方法

    这篇文章主要介绍了关于mysql 8.0.13zip包安装方法,非常不错,具有一定的参考借鉴价值 ,需要的朋友可以参考下
    2018-11-11
  • 关于MySQL的时间进位问题浅析

    关于MySQL的时间进位问题浅析

    这篇文章主要给大家介绍了关于MySQL的时间进位问题的相关资料,文中通过示例代码介绍的非常详细,对大家学习或者使用MySQL具有一定的参考学习价值,需要的朋友们下面来一起学习学习吧
    2019-12-12

最新评论