Newly installed a MySQL, created a new user dadmin, grant all permission
Mysql>grant all on * * to ' dadmin ' @ ' localhost ' identified by ' 123456 ';
Mysql>drop USER ' root ' @ ' localhost ';
Mysql>drop USER ' root ' @ ' localhost.localdomain ';
Mysql>drop USER ' root ' @ ':: 1 ';
Mysql>drop USER ' root ' @ ' 127.0.0.1 ';
Back just remembered, forgot to give ' dbaadmin ' @ '% ' remote permission, and then start authorizing
Mysql> GRANT All on * * to ' dadmin ' @ ' percent ' identified by ' 123456 ';
ERROR 1045 (28000): Access denied for user ' dadmin ' @ ' localhost ' (using Password:yes)
This problem occurs so that the solution:
Mysql>use MySQL
mysql> Update user Set grant_priv = ' Y ' where user = ' dadmin ';
Query OK, 1 row affected (0.03 sec)
Rows matched:1 changed:1 warnings:0
Mysql> commit;
Query OK, 0 rows Affected (0.00 sec)
mysql> flush Privileges;
Query OK, 0 rows affected (0.02 sec)
Mysql> quit// exit, connect again
Bye
[Email protected] ~]# mysql-udadmin-p
Enter Password:
Welcome to the MySQL Monitor. Commands End With; or \g.
Your MySQL Connection ID is 171
Server Version:5.6.13-log MySQL Community Server (GPL)
Copyright (c) and/or, Oracle, its affiliates. All rights reserved.
Oracle is a registered trademark of the Oracle Corporation and/or its
Affiliates. Other names trademarks of their respective
Owners.
Type ' help ', ' or ' \h ' for help. Type ' \c ' to clear the current input statement.
Mysql> GRANT All on * * to ' dadmin ' @ ' percent ' identified by ' 123456 ';
Query OK, 0 rows affected (0.03 sec)
Mysql> Show grants for ' dbaadmin ' @ '% '; //Authorized Success
+-------------------------------------------------------------------------------------------------------------- ----+
| Grants for [email protected]% |
+-------------------------------------------------------------------------------------------------------------- ----+
| GRANT all privileges on * * to ' dbaadmin ' @ '% ' identified by PASSWORD ' *ed09fa20652595d6114a30c5045a520b8a39839c ' |
+-------------------------------------------------------------------------------------------------------------- ----+
1 row in Set (0.00 sec)
This article is from the "Tiger Shengwei" blog, be sure to keep this source http://tobeone.blog.51cto.com/817917/1579153
MySQL Error Error 1045 (28000)