MySQL仅适用于:skip-grant-tables [英] MySQL only works with: skip-grant-tables

查看:446
本文介绍了MySQL仅适用于:skip-grant-tables的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我忘记了root密码,因此采用了几种不同的方法进行重置,最终都可以使用.

I forgot the root password, so followed a few different methods to reset, which eventually worked.

现在我无法在PHPmyAdmin上创建新数据库,显示消息无特权".

Now I am unable to create new databases on PHPmyAdmin, the message "no privileges" is displayed.

因此,我尝试使用以下方法再次将所有权限添加到ROOT:

So I try to add all the permissions to ROOT again using:

GRANT ALL PRIVILEGES ON *.* TO 'root'@'%' WITH GRANT OPTION;

但是我得到了错误:

#1290 - The MySQL server is running with the --skip-grant-tables option so it cannot execute this statement

因此,我从my.ini中删除了"skip-grant-tables",然后基于MySQL的站点停止工作.

So I remove the "skip-grant-tables" from my.ini, then my MySQL based sites stop working.

我正式捏造了吗?

推荐答案

确保清除特权:

GRANT ALL PRIVILEGES ON *.* TO 'root'@'%' WITH GRANT OPTION;
FLUSH PRIVILEGES;

文档:

冲洗特权

从mysql数据库的授权表中重新加载特权.

Reloads the privileges from the grant tables in the mysql database.

由于GRANT和CREATE USER语句,服务器将信息缓存在内存中.相应的REVOKE和DROP USER语句不会释放此内存,因此对于执行许多导致缓存的语句实例的服务器,将会增加内存使用量.可以使用FLUSH PRIVILEGES释放此缓存的内存.

The server caches information in memory as a result of GRANT and CREATE USER statements. This memory is not released by the corresponding REVOKE and DROP USER statements, so for a server that executes many instances of the statements that cause caching, there will be an increase in memory use. This cached memory can be freed with FLUSH PRIVILEGES.

这篇关于MySQL仅适用于:skip-grant-tables的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆