Linux系统下启动Mysql报错“Starting MySQL.. ERROR! The server quit without updating PID file”的综合分析

[重要通告]如您遇疑难杂症,本站支持知识付费业务,扫右边二维码加博主微信,可节省您宝贵时间哦!

这几天安装一个OA软件,用到linux系统,但是在mysql的时候就出错,也不晓得哪里问题,有问题就需要排除了,实属也没啥好办法;

(/usr/emp/data/mysqldata/centos-linux-7.pid)

[root@centos74 ~]# service mysqld start
Starting MySQL.. ERROR! The server quit without updating PID file (/usr/emp/data/mysqldata/centos-linux-7.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%最佳.
# 如果你的系统内存不大,查看这个参数,把它的值设置小一点.

9、关注 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

Linux下彻底卸载mysql详解

一、使用以下命令查看当前安装mysql情况,查找以前是否装有mysql

rpm -qa|grep -i mysql

二、停止mysql服务、删除之前安装的mysql

删除命令:rpm -e --nodeps 包名

三、查找之前老版本mysql的目录、并且删除老版本mysql的文件和库

find / -name mysql

删除对应的mysql目录

注意:卸载后/etc/my.cnf不会删除,需要进行手工删除

rm -rf /etc/my.cnf

四、再次查找机器是否安装mysql

rpm -qa|grep -i mysql

无结果,说明已经卸载彻底,接下来直接安装mysql即可。

初始化 MySQL:

mysqld --initialize

启动 MySQL:

systemctl start mysqld

查看 MySQL 运行状态:

systemctl status mysqld

注意:如果我们是第一次启动 mysql 服务,mysql 服务器首先会进行初始化的配置。

配置服务启动:

1、查看开机自动启动的服务使用chkconfig

chkconfig --list

2、确认mysql是否在启动运行状态

查询进程

ps -ef | grep mysqld

问题未解决?付费解决问题加Q或微信 2589053300 (即Q号又微信号)右上方扫一扫可加博主微信

所写所说,是心之所感,思之所悟,行之所得;文当无敷衍,落笔求简洁。 以所舍,求所获;有所依,方所成!

支付宝赞助
微信赞助

免责声明,若由于商用引起版权纠纷,一切责任均由使用者承担。

您必须遵守我们的协议,如您下载该资源,行为将被视为对《免责声明》全部内容的认可->联系老梁投诉资源
LaoLiang.Net部分资源来自互联网收集,仅供用于学习和交流,请勿用于商业用途。如有侵权、不妥之处,请联系站长并出示版权证明以便删除。 敬请谅解! 侵权删帖/违法举报/投稿等事物联系邮箱:service@laoliang.net
意在交流学习,欢迎赞赏评论,如有谬误,请联系指正;转载请注明出处: » Linux系统下启动Mysql报错“Starting MySQL.. ERROR! The server quit without updating PID file”的综合分析

发表回复

本站承接,网站推广(SEM,SEO);软件安装与调试;服务器或网络推荐及配置;APP开发与维护;网站开发修改及维护; 各财务软件安装调试及注册服务(金蝶,用友,管家婆,速达,星宇等);同时也有客户管理系统,人力资源,超市POS,医药管理等;

立即查看 了解详情