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

文章来源:http://icesquare.com/wordpress/mysql-starting-mysql-error-the-server-quit-without-updating-pid-file/

今天启动MySQL 遇见了这个问题,网上搜索,结果各种改文件,删除文件纯属坑爹;在上边的网站上发现了问题的解决方案~老外总结的真不错!拿过来自己学习一下

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.

1,启动MySQL
/usr/local/etc/rc.d/mysql.server start 
2,发现了下述错误  
  Starting MySQL..... ERROR! The server quit without updating PID file.

3,错误信息很明确的定位你出现的问题
 Starting MySQL..... ERROR! The server quit without updating PID file (/var/db/mysql/www.icesquare.com.pid).
三种解决方案如下:

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: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.

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

时间: 2024-08-04 09:47:53

MySQL: Starting MySQL….. ERROR! The server quit without updating PID file的相关文章

启动mysql报错 -- ERROR! The server quit without updating PID file

开发说某个测试环境的mysql,无法重启了,报以下错误提示: # service mysqld restart Shutting down MySQL.. SUCCESS! Starting MySQL. ERROR! The server quit without updating PID file (/usr/local/mysql/data/test.pid). # ps -ef|grep mysql|grep -v grep avahi 697 1 0 Sep16 ? 00:00:02

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

我在my.cnf中添加了一个log-bin=/data/docker/lisa/mysql/data/mysql-bin 重启mysql报错. [[email protected] data]# service mysql restart Shutting down MySQL.. SUCCESS! Starting MySQL. ERROR! The server quit without updating PID file (/data/docker/lisa/mysql/data//6e0

lnmp1.1 转移mysql数据库的问题 MySQL: Starting MySQL….. ERROR! The server quit without updating PID file

1.安装前修改/etc/my.cnf,加入datadir         = /data/mysql/   再执行sed -i 's/skip-locking/skip-external-locking/g' /etc/my.cnf 之后的命令,将里面的给目录加权限修改为你新的目录2.安装后停止mysql,移动/usr/local/mysql/var/ 到新目录,修改/etc/my.cnf ,查找[mysqld]  ,在下面加入datadir         = /data/mysql/  ,给

centos6.6下编译安装mysql5.6之后启动失败:Starting MySQL... ERROR! The server quit without updating PID file (/var/lib/mysql/localhost.localdomain.pid).

今天在编译安装mysql5.6时候出现Starting MySQL... ERROR! The server quit without updating PID file (/var/lib/mysql/localhost.localdomain.pid).,当时就心碎了,之前安装时候好好的,在网上搜索帮助方法,可是没有和我一样的,有的说我没有给mysqld赋权限,可是我赋予他权限了,试了一堆方法,最后心灰意冷,准备删除mysql重新安装,就在我执行:yum remove mysql mysql

[转]MySQL: Starting MySQL….. ERROR! The server quit without updating PID file

转自: 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 th

mysql启动报错:Starting MySQL... ERROR! The server quit without updating PID file

mysql启动时报错:Starting MySQL... ERROR! The server quit without updating PID file (/opt/mysql/data/mysql.pid) 的解决方法: 首先看一下我的mysql的配置文件的配置: cat /usr/local/mysql/my.cnf [mysqld] basedir = /usr/local/mysql datadir = /opt/mysql/data port = 3306 server_id = 1

mysql启动时报错:Starting MySQL... ERROR! The server quit without updating PID file (/opt/mysql/data/mysql.pid)

mysql启动报错Starting MySQL... ERROR! The server quit without updating PID file (/opt/mysql/data/mysql.pid) 查看mysql错误日志也没有写入. 最后发现是selinux打开,汗…… 参考 mysql启动时报错:Starting MySQL... ERROR! The server quit without updating PID file (/opt/mysql/data/mysql.pid)

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/local/mysql/data/vm10-0-0-19.ksc.com.pid). 解决: ./scripts/mysql_install_db --user=mysql --basedir=/usr/local/mysql/ --datadir=/usr/local/mysql/data/ 参考

mysql修改后启动my.cnf报错Starting MySQL... ERROR! The server quit without updating PID file (/var/lib/mysql/localhost.localdomain.pid).

mysql中文乱码解决 mysql修改my.cnf后启动报错Starting MySQL... ERROR! The server quit without updating PID file (/var/lib/mysql/localhost.localdomain.pid). 这里简单明了地说下: 对于mysql5.5版本,需要在/etc/mysql/my.cnf做如下修改: [client]下添加: default-character-set = utf8 [mysqld]下添加: cha