Create user:mysql> grant all on db1.* to [email protected] '% ' identified by ' 123456 '; Query OK, 0 rows Affected (0.00 sec) mysql> flush privlege; View:mysql> select User,host from mysql.user;+-------+------ -------+| user | Host |+-------+-------------+| Mycat | % || Root | 127.0.0.1 | | Repl | 192.168.2.% | | Root | :: 1 | | | localhost | | Root | localhost | | | mysql01 | | Root | Mysql01 |+-------+-------------+8 rows in Set (0.00 sec) test [[email protected] ~]$ mysql-umycat-p123456-h 127.0.0.1- P3316warning:using a password on the command line interface can is insecure. ERROR 1045 (28000): Access denied for user ' mycat ' @ ' localhost ' (using password:yes) solution: [[email protected] ~]$ Mysql-u R Oot-p123456-h 127.0.0.1-p3316mysql> use mysqlmysql> Delete from user where user= ';mysql> flush privileges; Test login successful [[email protected] ~]$ mysql-umycat-p123456-h 127.0.0.1-p3316mysql>
ERROR 1045 (28000): Access denied for user ' mycat ' @ ' localhost ' (using Password:yes)