今天,登陆阿里云账号后,发现服务器有一个警告说有漏洞,修复完后要重启服务器,想都没想直接重启了。。。

       接下来事情发生了,想着直接重启mysql就行。

      现象描述
              [root@iZwz952coo41my3i5b7x2iZ ]# service mysqld start
              Starting MySQL..The server quit without updating PID file (/usr/local/mysql/data/mysql/iZwz952coo41my3i5b7x2iZ.pid).[FAILED]

       启动数据库失败了,然后去找iZwz952coo41my3i5b7x2iZ.err这个文件,发现下面这一行:

        Can't open and lock privilege tables: Table 'mysql.user' doesn't exist

         解决方法:

                #查看/etc/my.cnf配置文件

                Can't open and lock privilege tables: Table 'mysql.user' doesn't exist

             #由于编译安装mysql时指定的路径为/usr/local/mysql以及mysql_install_db时指定的datadir也为/usr/local/mysql,而my.cnf为缺省的路径
     #因此修改datadir为正确路径后,问题解决

               [root@iZwz952coo41my3i5b7x2iZ ]# service mysqld start
     Starting MySQL.[  OK  ]

 

相关文章:

  • 2022-02-09
  • 2022-12-23
  • 2021-12-29
  • 2022-01-22
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
猜你喜欢
  • 2021-04-28
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-02-03
  • 2021-11-07
  • 2021-11-28
相关资源
相似解决方案