MySql-尽管授予了 GRANT ALL,但仍被拒绝访问

MySql-尽管授予了 GRANT ALL,但仍被拒绝访问

我在这里做错了什么?

 GRANT ALL PRIVILEGES ON *.* TO 'demoUser'@'localhost' REQUIRE NONE  
 WITH GRANT OPTION MAX_QUERIES_PER_HOUR 0 MAX_CONNECTIONS_PER_HOUR 0  
 MAX_UPDATES_PER_HOUR 0 MAX_USER_CONNECTIONS 0;

C:\Users\me>"C:\Program Files\MySQL\MySQL Server 5.7\bin\mysql.exe"   
  "--defaults-file=C:\ProgramData\MySQL\MySQL Server 5.7\my.ini" -udemoUser -pitsAsecret

mysql: [Warning] Using a password on the command line interface can be insecure.
ERROR 1045 (28000): Access denied for user 'demoUser'@'localhost' (using password: YES)

答案1

授予该用户权限时,您没有设置密码。您应该使用类似以下内容:

GRANT ALL ON ... TO ... IDENTIFIED BY 'itsAsecret';

相关内容