Conceder erro de permissões no MySQL

1

Sou um novo administrador do MySQL na linha de comando e geralmente uso o Phpmyadmin ou o MySql workbench para as máquinas administrativas. Estou tendo um problema ao tentar conceder acesso de usuário aos bancos de dados e esperando poder obter alguma ajuda para descobrir isso.

    [root@server20039]# mysql -u root -p
Enter password:
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 21
Server version: 5.5.29 MySQL Community Server (GPL)

Copyright (c) 2000, 2012, Oracle and/or its affiliates. All rights reserved.

Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective
owners.

Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.

mysql> GRANT ALL ON *.* TO 'maintenance'@'localhost' IDENTIFIED BY 'qwerty' WITH GRANT OPTION;
ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: YES)

Então eu tentei isso e ainda recebi o mesmo erro

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

e isso

GRANT ALL PRIVILEGES ON *.* TO 'root'@'%'
    IDENTIFIED BY PASSWORD 'qwerty'  
    WITH GRANT OPTION;
FLUSH PRIVILEGES;

Eu realmente poderia usar uma mão para descobrir isso!

    
por bakesale 27.04.2013 / 01:41

1 resposta

3

Verifique o usuário:

mysql> SELECT CURRENT_USER();
+----------------+
| CURRENT_USER() |
+----------------+
| root@localhost |
+----------------+
1 row in set (0.00 sec)

Verifique os privilégios:

mysql> SHOW GRANTS;
+----------------------------------------------------------------------------------------------------------------------------------------+
| Grants for root@localhost                                                                                                              |
+----------------------------------------------------------------------------------------------------------------------------------------+
| GRANT ALL PRIVILEGES ON *.* TO 'root'@'localhost' IDENTIFIED BY PASSWORD '*03465AB87C2B44D98228458669A91479C2BAAA6C' WITH GRANT OPTION |
| GRANT PROXY ON ''@'' TO 'root'@'localhost' WITH GRANT OPTION                                                                           |
+----------------------------------------------------------------------------------------------------------------------------------------+
2 rows in set (0.00 sec)

Se você atualizou recentemente o MySQL, execute: mysql_upgrade e reinicie o daemon do MySQL.

    
por 27.04.2013 / 09:05

Tags