删除mysql文件夹权限_mysql 删除一条root@localhost的权限后 丢失所有权限

使用phpMyAdmin过程中,在删除一条root@localhost的权限后,不知道什么原因root的用户丢失了所有权限。现象:控制台mysql-uroot-p能正常登陆,登陆后showgrants发现只有下面一个权限G...

使用phpMyAdmin过程中,在删除一条root@localhost的权限后,不知道什么原因root的用户丢失了所有权限。

现象:

控制台mysql -u root -p

能正常登陆,登陆后show grants

发现只有下面一个权限

GRANT USAGE ON *.* TO 'root'@'localhost' IDENTIFIED BY PASSWORD '*1A7CAB。。。。。。‘

现在root用户什么也干不了了,怎么回复root的权限。

网上搜了一下,也许用mysqld_safe --SKIP-GRANT-TABLES启动后来回复,

但是不知道怎么原因,运行mysqld_safe命令后又出现以下错误消息:

141111 20:22:41 mysqld_safe The file /usr/local/mysql/bin/mysqld

does not exist or is not executable. Please cd to the mysql installation

directory and restart this script from there as follows:

./bin/mysqld_safe&

See http://dev.mysql.com/doc/mysql/en/mysqld-safe.html for more information

ps:我的mysql没有安装在/usr/local/mysql/而是安装在其他地方的

创建一个从/usr/local/mysql到mysql安装目录的软连接后 mysqld_safe能正常运行了,但是加了--SKIP-GRANT-TABLES启动后是不能运行grant命令。

mysql> grant ALL PRIVILEGES on *.* to root@"localhost" Identified by "root" WITH GRANT OPTION;

ERROR 1290 (HY000): The MySQL server is running with the --skip-grant-tables option so it cannot execute this statement

自己解决了,mysqld_safe --skip-grant-tables启动

修改user表后

flush privileges;

就OK了

展开

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值