文档章节

MySQL he server quit without updating PID file解决办法

五大三粗
 五大三粗
发布于 2015/04/12 00:28
字数 1029
阅读 107
收藏 0
点赞 0
评论 0

1 问题

[root@localhost mysql]# /etc/rc.d/init.d/mysql status
MySQL is not running, but lock file (/var/lock/subsys/mysql[FAILED]
[root@localhost mysql]# /etc/rc.d/init.d/mysql start
Starting MySQL...The server quit without updating PID file (/usr/local/mysql/data/localhost.localdomain.pid).                              [FAILED]

 

2 原因

没有初始化权限表

 

3 解决办法

#cd /usr/local/mysql(进入mysql安装目录)
#chown -R mysql.mysql .
#su - mysql
$cd server
$scripts/mysql_install_db

 

4 本人解决过程

[root@localhost ~]# cd /usr/local/mysql

[root@localhost mysql]# chown -R mysql.mysql .
[root@localhost mysql]# su - mysql
[mysql@localhost ~]$ cd /usr/local/mysql
[mysql@localhost mysql]$ scripts/mysql_install_db
Installing MySQL system tables...
OK
Filling help tables...
OK

To start mysqld at boot time you have to copy
support-files/mysql.server to the right place for your system

PLEASE REMEMBER TO SET A PASSWORD FOR THE MySQL root USER !
To do so, start the server, then issue the following commands:

./bin/mysqladmin -u root password 'new-password'
./bin/mysqladmin -u root -h localhost.localdomain password 'new-password'

Alternatively you can run:
./bin/mysql_secure_installation

which will also give you the option of removing the test
databases and anonymous user created by default.  This is
strongly recommended for production servers.

See the manual for more instructions.

You can start the MySQL daemon with:
cd . ; ./bin/mysqld_safe &

You can test the MySQL daemon with mysql-test-run.pl
cd ./mysql-test ; perl mysql-test-run.pl

Please report any problems with the ./bin/mysqlbug script!

[mysql@localhost mysql]$ /usr/local/mysql/bin/mysqld_safe --user=mysql &
[1] 11767
[mysql@localhost mysql]$ 120502 07:01:17 mysqld_safe Logging to '/usr/local/mysql/data/localhost.localdomain.err'.
120502 07:01:17 mysqld_safe Starting mysqld daemon with databases from /usr/local/mysql/data
[mysql@localhost mysql]$ /etc/rc.d/init.d/mysql status
MySQL running (11830)                                       OK  ]
[mysql@localhost mysql]$ /etc/rc.d/init.d/mysql start
Starting MySQL                                              OK  ]

 

 

附一文:MySQL: Starting MySQL….. ERROR! The server quit without updating PID file

FROM:http://icesquare.com/wordpress/mysql-starting-mysql-error-the-server-quit-without-updating-pid-file/

 

MySQL: <wbr>Starting <wbr>MySQL….. <wbr>ERROR! <wbr>The <wbr>server <wbr>quit <wbr>without <wbr>updating <wbr>PID <wbr>file解决办法



This step-by-step guide is mainly for FreeBSD, however the idea is the same for Linux. Every once a while, when I update my FreeBSD box, the system likes to shutdown my MySQL server. Therefore, I need to start it again after the update is done. Unfortunately, the upgrade process is not smooth every time. Sometimes it will throw me some error.

/usr/local/etc/rc.d/mysql.server start

Oh well, I got the following error messages:

Starting MySQL..... ERROR! The server quit without updating PID file.

Sometimes, the message will tell you the exact location of which PID file:

Starting MySQL..... ERROR! The server quit without updating PID file (/var/db/mysql/www.icesquare.com.pid).

There are several solutions to troubleshoot these problems. I will go over each one by one.

Solution 1: Reboot The Computer

Although it sounds simple, but it really works. During the system upgrade, the OS may disable some of your daemons. Instead of troubleshooting each one by one, the easiest way is to start everything over. For example, I experienced this problem today after upgrading the Apache and Ruby (Yes, MySQL is not part of the update), and I got this error message afterward. After rebooting the computer, the error message is gone.

Solution 2: Remove Your MySQL Config File

If you have modified your MySQL configuration file, MySQL may not like it few versions after (MySQL is not backward compatibility friendly). It can be the problem of using an unsupported variable, or something similar. The easiest way is to remove your configuration file, and try to start the MySQL server again:

Backup your MySQL configuration first.

mv /etc/my.cnf /etc/my.cnf.backup

And restart the MySQL server again:

/usr/local/share/mysql/mysql.server start

Hopefully you will see the following message:

Starting MySQL. SUCCESS!

Solution 3: Upgrade Your Database File

Sometimes, the newer MySQL doesn’t like the database created in earlier version. I discovered this when I upgrade to MySQL 5.5.7:

Starting MySQL..... ERROR! The server quit without updating PID file (/var/db/mysql/www.icesquare.com.pid).

Since MySQL tells me which PID file causes the problem, I open the file and take a look what’s going on:

sudo tail /var/db/mysql/www.icesquare.com.err

And I saw something interesting: tables: Table ‘mysql.proxies_priv’ doesn’t exist:

101112 10:49:16 InnoDB: Initializing buffer pool, size = 128.0M 101112 10:49:16 InnoDB: Completed initialization of buffer pool 101112 10:49:16 InnoDB: highest supported file format is Barracuda. 101112 10:49:17 InnoDB: 1.1.3 started; log sequence number 1589404 101112 10:49:17 [ERROR] Fatal error: Can't open and lock privilege tables: Table 'mysql.proxies_priv' doesn't exist 101112 10:49:17 mysqld_safe mysqld from pid file /var/db/mysql/www.icesquare.com.pid ended
 

The reason is very simple. MySQL could not open a table created in the earlier version (< 5.7.7) because it is not compatible with the current version. So, we can try to start the MySQL in safe mode through rc.d. First, you can edit the /etc/rc.conf and put the following into the file:

mysql_enable="YES" mysql_args="--skip-grant-tables --skip-networking"

Restart MySQL through rc.d:

/usr/local/etc/rc.d/mysql-server start

If you did it right, you should see something like the following:

Starting MySQL.. SUCCESS!

Now, MySQL is already running the safe-mode. We want to perform a MySQL upgrade on all tables:

sudo mysql_upgrade

You should see something like this:

Looking for 'mysql' as: mysql Looking for 'mysqlcheck' as: mysqlcheck Running 'mysqlcheck' with connection arguments: '--port=3306' '--socket=/tmp/mysql.sock' Running 'mysqlcheck' with connection arguments: '--port=3306' '--socket=/tmp/mysql.sock' mysql.columns_priv OK mysql.db OK mysql.event OK mysql.func OK mysql.general_log OK mysql.help_category OK mysql.help_keyword OK mysql.help_relation OK mysql.help_topic OK mysql.host OK mysql.ndb_binlog_index OK mysql.plugin OK mysql.proc OK mysql.procs_priv OK mysql.servers OK mysql.slow_log OK mysql.tables_priv OK mysql.time_zone OK mysql.time_zone_leap_second OK mysql.time_zone_name OK mysql.time_zone_transition OK mysql.time_zone_transition_type OK mysql.user OK Running 'mysql_fix_privilege_tables'... OK

Now, we want to switch the MySQL back to normal mode by commenting the extra options in /etc/rc.conf:

mysql_enable="YES" #mysql_args="--skip-grant-tables --skip-networking"

And restart MySQL through /etc/rc.d:

/usr/local/etc/rc.d/mysql-server restart

Now the MySQL is up and running again!

Happy MySQLing.

–Derrick

© 著作权归作者所有

共有 人打赏支持
五大三粗
粉丝 157
博文 2215
码字总数 4578339
作品 0
广州
程序员
Starting MySQL. ERROR! The server quit without updating PID file

我在my.cnf中添加了一个log-bin=/data/docker/lisa/mysql/data/mysql-bin 重启mysql报错。 [root@6e05ca49e205 data]# service mysql restart Shutting down MySQL.. SUCCESS! Starting MySQ......

莎吧啦
2016/12/28
0
0
Mysql启报错报The server quit without updating PID file

mysql 安装时候安装后启动不成功报错: Starting MySQL.. ERROR! The server quit without updating PID file (/data/mysql/26765574162f.pid). 查看报错日志: [ERROR] Fatal error: Can't......

枫叶云
02/10
0
0
Linux MySQL 常见无法启动或启动异常的解决方案

Linux MySQL 常见无法启动或启动异常的解决方案   在 Linux 上自建 MySQL 服务器,经常遇到各种无法启动或启动后异常的问题,本文列举一些常见问题的解决办法。   注意:以下错误日志提示...

xiaocao13140
05/24
0
0
mysql二进制安装的问题

二进制安装后,启动时出现问题(mysql安装在/application/msyql下): [root@135 bin]# /etc/init.d/mysqld start Starting MySQL.170320 22:21:51 mysqld_safe The file /usr/local/mysql/......

灼灼123
2017/03/20
0
0
mysql安装错误

问题!![root@lsx-001 mysql]# ./scripts/mysql_install_db --user=mysql --datadir=/data/mysqlFATAL ERROR: please install the following Perl modules before executing ./scripts/mysq......

虾米的春天
2017/12/06
0
0
mysql启动不了,重启也没用

问题描述: 今天有一台服务器mysql启动不了,重启服务报下面的错误: Warning: World-writable config file '/usr/local/kk-mail/service/mysql/conf/my.cnf' is ignored Starting MySQL... ......

sailikung
03/28
0
0
mysql二进制安装启动的问题

二进制安装后,启动时出现问题(mysql安装在/application/msyql下): [root@135 bin]# /etc/init.d/mysqld start Starting MySQL.170320 22:21:51 mysqld_safe The file /usr/local/mysql/......

灼灼123
2017/03/22
0
0
centos6.6 下编译安装mysql5.6

我在centos6.6 下编译安装mysql5.6。安装完成后,启动mysql,service mysqld start 时报错。如下: Starting MySQL..The server quit without updating PID file ([FAILED]al/mysql/data/iZ2......

大圈
2015/10/30
247
2
编译安装mysql与mysql error 解决之道

今天在济南出差,通过尝试编译安装mysql,使得一个诡异的问题得到解决。下面以流水的方式记述一下问题具体是怎样得到解决的。 昨天转发了一篇博文——error : The server quit without updat...

SVD
2015/07/11
0
1
linux平台安装Mysql报错

安装过程: [root@ibt syssoft]# rpm -ivh MySQL-server-5.1.56-1.glibc23.x86_64.rpm Preparing... ########################################### [100%] 1:MySQL-server #################......

阿咪
2011/05/05
1K
6

没有更多内容

加载失败,请刷新页面

加载更多

下一页

iOS安全应该做哪些事情

1. 尽量使用HTTPS协议。 2. 密码提交的时候,密码使用SHA256加密后传输,MD5等经过哈希碰撞已经可以推算出原文。 3. 密码提交的时候,可以加盐。 4. 密码保存在本地的时候,尽量使用钥匙串保...

HOrange
8分钟前
0
0
react native 注意事项

1. 环境参考官网 android studio 必装 java jdk安装 1.8版本(环境建议自己一步一步配置,切记不要 apt ) 2.有改变编译内容发现 会白屏,然后APP消失,请卸载原来的测试 appinfo (连续两次...

304158
14分钟前
0
0
FOMO游戏代码解析

源代码在此处

怎当她临去时秋波那一转
19分钟前
1
0
EOS智能合约与DApp开发入门

EOS的是Block.One主导研发的一个区块链底层公链系统,它专门为支撑商业去中心化 应用(Decentralized Application)而设计,其代码开源。 比特币被称为区块链1.0,因为它开辟了数字加密货币的...

笔阁
32分钟前
1
0
编译cjson到dll

https://blog.csdn.net/mengzhisuoliu/article/details/52203724 编译完成后 是纯lua实现的json decode 的10倍以上...

梦想游戏人
41分钟前
0
0
JS基础- Date 对象

Date 对象 Date 对象用于处理日期和时间。 创建 Date 对象的语法: var myDate=new Date() 注释:Date 对象会自动把当前日期和时间保存为其初始值。 Date 对象属性 属性 描述 constructor 返...

ZHAO_JH
43分钟前
0
0
Python数据分析numpy(1)

Python开源的科学计算基础库 1.表示N维数组对象ndarray 2.线性代数、傅里叶变换、随机数生成 3.广播函数,整合c++、c 一.数据的维度 1.数据 2.数据维度 3.一维数据 (1)特点 (2)Python中的...

十年磨一剑3344
46分钟前
1
0
csv导入Hive脚本

from pyspark.sql import HiveContexthivec = HiveContext(sc) # 创建一个hivecontext对象用于写执行SQL,sc为sparkcontext# 拼接一个字段类型字符串str_s = 'label String,'...

gulf
48分钟前
0
0
TensorFlow 隐含层 拟合 异或运算

a⊕b = (¬a ∧ b) ∨ (a ∧¬b) 数据 X = [[0, 0], [0, 1], [1, 0], [1, 1]]Y = [[0], [1], [1], [0]] 单层网络只能拟合线性问题,由于异或是非线性问题,需要使用多层网络 输入和输出 [[...

阿豪boy
今天
0
0
SVN 教程

http://www.runoob.com/svn/svn-tutorial.html 记一次 svn 管理的项目迁移工作 之前A服务器上的项目版本管理工具是用的SVN,后来,之前管理linux服务器的员工离职了,这管理服务器的工作也就...

yeahlife
今天
0
0

没有更多内容

加载失败,请刷新页面

加载更多

下一页

返回顶部
顶部