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/

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

来源:http://blog.csdn.net/orichisonic/article/details/47021379

MySQL: Starting MySQL….. ERROR! The server quit without updating PID file解决办法相关推荐

  1. Starting MySQL... ERROR The server quit without updating PID file 解决办法

    百度了许多方法未果,偶然在一篇文章下的评论里发现了解决办法,如下: 在/etc/my.cnf文件里的[mysqld]下添加"user=root" 然后执行 service mysq ...

  2. ERROR! The server quit without updating PID file解决办法

    我的个人博客:逐步前行STEP 先新建PID文件,并且设置目录权限 再新建sock文件,并且设置目录权限 重启即可 重要的是在my.cnf中设置log_error使之打印日志,然后参考日志去解决错误

  3. 【MySQL】修改配置后,重启MySQL报错[ERROR] The server quit without updating PID file

    问题: 在没有修改配置时,MySQL启动正常: 错1:修改配置后MySQL启动不了,报错: [root@localhost mysql]# service mysql restart Starting ...

  4. 解决执行Mysql报错: ERROR: The server quit without updating PID file (/data/xxx.pid)

    昨天在Linux中安装mysql-8.0.28时遇到了这个报错: ERROR! The server quit without updating PID file (/data/xxx.pid) 其实 ...

  5. Starting MySQL... ERROR! The server quit without updating PID file 问题解决

    Starting MySQL... ERROR! The server quit without updating PID file 问题解决 参考文章: (1)Starting MySQL... E ...

  6. Starting MySQL.. ERROR! The server quit without updating PID file (/usr/local/mysql/data/vm10-0-0-19

    输入:service mysqld start 报错: Starting MySQL.. ERROR! The server quit without updating PID file (/usr/ ...

  7. Mysql 启动报错解析:Starting MySQL.. ERROR! The server quit without updating PID file (/usr/local/mysql/dat

    现象: root@centos74 ~]# service mysqld start Starting MySQL.. ERROR! The server quit without updating ...

  8. mysql服务启动失败 Starting MySQL. ERROR! The server quit without updating PID file

    [问题描述] 使用 service mysqld start 启动mysql服务失败,提示 Starting MySQL. ERROR! The server quit without updatin ...

  9. 解决 Starting MySQL ERROR The server quit without updating PID file

    服务器断电重启后mysql启动报错,记录一下解决方案 环境 mysql版本 5.7.21 服务器 Red Hat Enterprise Linux Server release 7.6 (Maipo) ...

最新文章

  1. 为什么数据线easy糟糕
  2. winpython使用教程-使用Python开发windows桌面程序【超简单】
  3. 有关RSA 命令总结
  4. Django中url匹配规则的补充
  5. 谈谈阿里所谓的“要性”
  6. 极端懒惰:使用Spring Boot开发JAX-RS服务
  7. 监听网页微信扫码支付成功_网付扫码点餐新福利,消费者点餐可获微信支付金币奖励...
  8. 机器学习笔记(二十四):召回率、混淆矩阵
  9. 全球DDOS安全防护
  10. VS绿豆沙屏幕保护色参数设置
  11. 利用VSCode+platformio学习esp32开发
  12. 荣耀v30能用鸿蒙吗,荣耀30、V30和20系列等用户有福啦
  13. 中国房价必跌的40个理由
  14. unity2d里实现鼠标拖拽物体的功能
  15. 爬取QQ音乐周杰伦前五页歌曲的歌词
  16. linux读取spd信息,linux怎样读取memory spd
  17. 带你入门多目标跟踪(四)外观模型 Appearance Model
  18. [Hadoop] mac搭建hadoop3.X 伪分布模式
  19. Codeforces 1322 A. Unusual Competitions
  20. JavaScript调用原生API获取手机型号

热门文章

  1. linux下重启weblogic(关闭和启动)
  2. 怎样在Ubuntu 14.04中搭建gitolite git服务器
  3. 4.录屏软件录屏端和接收端程序
  4. Linux 常见命令之Find \; +结合其它命令使用案例详解
  5. cxf 本地wsdl_cxf使用wsdl文件生成代码
  6. faster rcnn流程
  7. 我对CopyOnWrite的思考
  8. 如何在React中做到jQuery-free
  9. 让问答更自然 - 基于拷贝和检索机制的自然答案生成系统研究 | 论文访谈间 #02...
  10. ASP.NET Aries JSAPI 文档说明:AR.DataGrid、AR.Dictionary