1044: Access denied for user 'hehe'@'localhost' to database 'imooc'

时间:2022-09-26 19:19:59

当我使用 mysql授予用户时,

GRANT ALL PRIVILEGES ON *.* TO hehe IDENTIFIED BY 'some' WITH GRANT OPTION;

出现:1044: Access denied for user 'hehe'@'localhost' to database 'imooc'

修改成这样:
GRANT ALL PRIVILEGES ON *.* TO hehe@localhost IDENTIFIED BY 'some' WITH GRANT OPTION;
就没有错误了,也可以在phpmyadmin之类中 将
  主机: %
修改成:
  主机:localhost


新问题:
当我 用phpmyadmin 创建新用户连接的时候
Warning: mysqli::mysqli(): (HY000/1044): Access denied for user 'tumi'@'localhost' to database 'imooc' in E:\phpPro\phpStu\PDOImooc\MYSQL.php on line 2
发现新创建的用户什么权限都没有。
然后编辑权限-》全局权限 就好了