Cannot log in with created user in mysql

前端 未结 12 1854
小蘑菇
小蘑菇 2020-12-07 15:31

Using this command

GRANT ALL PRIVILEGES ON *.* to \'brian\'@\'%\' identified by \'password\';

I try to login with:

 mysql -         


        
12条回答
  •  隐瞒了意图╮
    2020-12-07 16:12

    I think 'Russell Silva' is right...

    I created an user by

    CREATE USER 'username'@'%' PASSWORD='userpassword';
    

    But I cannot login in this account.The console told me that

    ERROR 1045 (28000): Access denied for user 'username'@'localhost' (using password: YES)
    

    So I created an user with the same username except that changing '%' to 'localhost',and I could finally login in as 'username'. It's quite weird for me though.

提交回复
热议问题