[root@localhost ~]# /etc/init.d/mysql stopMySQL server PID file could not be found! [失败][root@localhost ~]# ps aux | grep mysqlroot 2204 0.0 0.3 5732 952 ? S Jun15 0:00 /bin/sh /usr/local/mysql/bin/mysqld_safe --datadir=/usr/local/mysql/data --pid-file=/usr/local/mysql/data/localhost.localdomain.pidmysql 2456 0.0 2.5 331604 6556 ? Sl Jun15 0:01 /usr/local/mysql/bin/mysqld --basedir=/usr/local/mysql --datadir=/usr/local/mysql/data --plugin-dir=/usr/local/mysql/lib/plugin --user=mysql --log-error=/usr/local/mysql/data/localhost.localdomain.err --pid-file=/usr/local/mysql/data/localhost.localdomain.pid --socket=/tmp/mysql.sock --port=3306root 18224 0.1 0.4 5684 1168 pts/3 S 02:07 0:00 /bin/sh /usr/local/mysql/bin/mysqld_safe --datadir=/usr/local/mysql/data --pid-file=/usr/local/mysql/data/localhost.pidmysql 18476 0.6 10.4 285288 26608 pts/3 Sl 02:07 0:00 /usr/local/mysql/bin/mysqld --basedir=/usr/local/mysql --datadir=/usr/local/mysql/data --plugin-dir=/usr/local/mysql/lib/plugin --user=mysql --log-error=/usr/local/mysql/data/localhost.err --pid-file=/usr/local/mysql/data/localhost.pid --socket=/tmp/mysql.sock --port=3306root 18593 0.0 0.2 5108 672 pts/3 R+ 02:08 0:00 grep mysql
解决办法:
将所有mysql的进程kill掉,重新启动
[root@localhost ~]# /etc/init.d/mysql startStarting MySQL... [确定][root@localhost ~]# ps aux | grep mysqlroot 18618 1.1 0.4 5684 1168 pts/3 S 02:08 0:00 /bin/sh /usr/local/mysql/bin/mysqld_safe --datadir=/usr/local/mysql/data --pid-file=/usr/local/mysql/data/localhost.pidmysql 18870 4.5 12.8 329692 32796 pts/3 Sl 02:08 0:00 /usr/local/mysql/bin/mysqld --basedir=/usr/local/mysql --datadir=/usr/local/mysql/data --plugin-dir=/usr/local/mysql/lib/plugin --user=mysql --log-error=/usr/local/mysql/data/localhost.err --pid-file=/usr/local/mysql/data/localhost.pid --socket=/tmp/mysql.sock --port=3306root 18919 0.0 0.2 5108 672 pts/3 R+ 02:09 0:00 grep mysql[root@localhost ~]# /etc/init.d/mysql stopShutting down MySQL. [确定]