我真的试过了我在这里找到的一切。 所以我想我忘记了我的root密码,...进入救援模式后 --skip-grant-tables我发现,没有root用户(不再?)。
所以,..是的,很棒,..。如何解决它没有特权用户了吗? 我无法使用“CREATE USER ...”创建一个,因为我处于skip-grant-tables模式,...
所以我决定手动插入用户。现在我有我的root用户,凭证等等,但是我无法授予对所有表和权限的访问权限。
我尝试了这个(我用我''新'创建的root帐户连接到mysql):
mysql> SHOW GRANTS FOR 'root'@'localhost';
+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| Grants for root@localhost |
+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| GRANT SELECT, INSERT, UPDATE, DELETE, CREATE, DROP, RELOAD, SHUTDOWN, PROCESS, FILE, REFERENCES, INDEX, ALTER, SHOW DATABASES, SUPER, CREATE TEMPORARY TABLES, LOCK TABLES, EXECUTE, REPLICATION SLAVE, REPLICATION CLIENT, CREATE VIEW, SHOW VIEW, CREATE ROUTINE, ALTER ROUTINE, CREATE USER ON *.* TO 'root'@'localhost' WITH GRANT OPTION |
+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
1 row in set (0.00 sec)
好的...... 然后:
mysql> GRANT ALL ON *.* TO 'root'@'localhost';
ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: YES)
mysql>
什么?
mysql> select Grant_priv, Super_priv from user where User='root';
+------------+------------+
| Grant_priv | Super_priv |
+------------+------------+
| Y | Y |
+------------+------------+
1 row in set (0.00 sec)
mysql>
我不明白......
是的,我冲了这个特权。我多次重启服务。但是我仍然无法授予root用户访问权限。
请帮助:(