升级了下MySQL数据库,同时重新启动了server,重新启动后server后,mysql报错如下:
0 1 |
[root@nginx var]# service mysql start Starting MySQL. ERROR! Manager of pid-file quit without updating file. |
查看mysql.log看到如下信息:
[root@nginx var]# vi /var/log/mysqld.log
0 1 |
140306 15:54:31 InnoDB: Started; log sequence number 0 44233 140306 15:54:31 [ERROR] Fatal error: Can't open and lock privilege tables: Table 'mysql.host' doesn't exist |
好吧,问题找到了,来修改成之前的数据库位置。SourceByrd's Weblog-https://note.t4x.org/error/mysql-updating-error/
[root@nginx var]# vi /etc/my.cnf
0 1 2 3 4 5 6 7 8 9 |
[mysqld] datadir=/var/lib/mysql socket=/var/lib/mysql/mysql.sock user=mysql # Disabling symbolic-links is recommended to prevent assorted security risks symbolic-links=0 [mysqld_safe] log-error=/var/log/mysqld.log pid-file=/var/run/mysqld/mysqld.pid |
到此我以为完成了,因为服务器提示mysql数据库启动成功了,但是依然无法连接到数据库。猜测可能是权限的问题。
0 1 2 3 4 5 6 7 8 9 |
[mysqld] datadir=/usr/local/mysql/var socket=/tmp/mysql.sock user=mysql # Disabling symbolic-links is recommended to prevent assorted security risks symbolic-links=0 [mysqld_safe] log-error=/var/log/mysqld.log pid-file=/var/run/mysqld/mysqld.pid |
做此修改后,数据库可以正常连接,一切正常!
申明:本文由BYRD原创(基于Centos6.4 X64),未经许可禁止转载!SourceByrd's Weblog-https://note.t4x.org/error/mysql-updating-error/
SourceByrd's Weblog-https://note.t4x.org/error/mysql-updating-error/
申明:除非注明Byrd's Blog内容均为原创,未经许可禁止转载!详情请阅读版权申明!