[ERROR] Fatal error: Can't open and lock privilege tables: Table 'mysql.user' doesn't exist

这个问题是由于data的目录下没有安装数据库表

解决方法:

vi /etc/my.cnf

修改为正确的datadir=“xxxxx”即可

然后service mysqld start

service mysql start

正常启动后,会再/var/lib/mysql下面生成mysql.sock文件,

然后还报:ERROR 2002 (HY000): Can‘t connect to local MySQL server through socket ‘/tmp/mysql.sock‘

可以指定mysql.sock路径:

mysql -u root -p -S /var/lib/mysql/mysql.sock

还有有时候是你的目录权限的问题:

记得赋权限:chown -R mysql:mysql  /usr/local/mysql

以上是转自 http://blog.csdn.net/ec06cumt/article/details/50778240

我检查了data文件下是没有数据库文件也就是上面所说的“由于data的目录下没有安装数据库表”

但是我的问题是,服务器上数据库被黑掉了,所有数据都被删掉了(包括mysql自带的数据库),所以我的解决方法思路:1.复制一份系统数据文件过去;2.重装mysql。

于是我把我本地的mysql,performance_schema,test三个文件夹拷至服务器的data文件夹下重启我的phpstudy(我的是集成环境)。OK   问题解决

[ERROR] Fatal error: Can't open and lock privilege tables: Table 'mysql.user' doesn't exist

原文地址:https://www.cnblogs.com/brice/p/8449114.html

时间: 2024-11-10 15:09:05

[ERROR] Fatal error: Can't open and lock privilege tables: Table 'mysql.user' doesn't exist的相关文章

[ERROR] Fatal error: Can't open and lock privilege tables: Table 'mysql.host' doesn't exist

[[email protected] scripts]# ./mysql_install_db --user=mysql --basedir=/app/servers/mysql-5.5.20 --datadir=/app/servers/mysql-5.5.20/data/ 加上--datadir=/app/servers/mysql-5.5.20/data/ 问题解决!!! [ERROR] Fatal error: Can't open and lock privilege tables:

Fatal error: Can't open and lock privilege tables: Table 'mysql.host' doesn't exist

[[email protected] download]# service mysqld start Redirecting to /bin/systemctl start  mysqld.service Job for mysqld.service failed because a timeout was exceeded. See "systemctl status mysqld.service" and "journalctl -xe" for details

Mysql报错Fatal error: Can't open and lock privilege tables: Table 'mysql.host' doesn't exist

安装mysql后,启动时候没有启动成功,查看了下日志报错如下:--------------------------------------------- 1   可以:初始化mysql:mysql_install_db 2   目录权限问题chown -R mysql:mysql  /var/lib/mysql [[email protected] local]# less /var/log/mysqld.log1.查看报错信息如下:[ERROR] Fatal error: Can't open

【转】安装mysql 出现:Fatal error: Can't open and lock privilege tables: Table 'mysql.user' doesn't exist

来源:http://blog.csdn.net/dapeng0112/article/details/37053407 本来初始化配置是这样的: scripts/mysql_install_db --basedir=/usr/local/mysql --datadir=/usr/local/mysql/data --user=mysql 出现了 [[email protected] mysql-5.6.14]# service mysql restart ERROR! MySQL server

mysql启动报错:Fatal error: Can’t open and lock privilege tables: Table ‘mysql.host’ doesn’t exist

mysql在首次启动的时候可能会报错:Can’t open and lock privilege tables: Table ‘mysql.host’ doesn’t exist 这时候可以执行脚本 mysql_install_db –user=mysql –ldata=数据存放的路径

启动mysql问题Can't open and lock privilege tables: Table 'mysql.host' doesn't exist

启动mysql出现问题 /etc/init.d/mysqld start MySQL server PID file could not be found![FAILED] Starting MySQL......................................The server quit without updating PID file (/data/mysql/mysql_3306/data/mysql.pid).[FAILED] 查看错误日志 150619 15:57:

linux mysql启动报错Can't open and lock privilege tables: Table 'mysql.host' doesn't exist

vi /etc/my.cnf  查看日志文件路径: log-error=/var/log/mysqld.log 查看报错日志: 之前的服务器被别人拿了,所以自己买了台美国vps,根据笔记安装完启动mysql,又启动不了. 查看了错误日志 引用 090321 18:55:03 mysqld_safe Starting mysqld daemon with databases from /usr/local/mysql/data /usr/local/mysql/libexec/mysqld: Ta

mysql安转过程中出现的问题! Fatal error: Can't open and lock privilege tables: Table 'mysql.user' doesn't exis

net start mysql启动失败,报错信息如上,因缺少mysql这个库 所以跳过 在my.ini中添加 --skip-grant-tables 再启动mysql 然后进入mysql 倒入一个从其他机器中拷贝的mysql.sql 再把my,ini中的--skip-grant-tables注释掉 就可以启动了! mysql安转过程中出现的问题! Fatal error: Can't open and lock privilege tables: Table 'mysql.user' doesn

MySQL [ERROR] Table 'mysql.user' doesn't exist

一次源码新装的mysql,由于没有复制my-default.cnf到/etc/my.cnf位置,在启动mysql的时候碰到了无法打开mysql.user表的错误.具体错误为:[ERROR] Fatal error: Can't open and lock privilege tables: Table 'mysql.user' doesn't exist.下面是该错误的描述及其解决办法. 1.现象描述[[email protected] scripts]# service mysqld star