1. 查看某个用户的权限
mysql> show grants for ‘episode‘@‘%‘;
2.为用户添加某个数据库的权限:
mysql> GRANT ALL PRIVILEGES ON `episode_cc`.* TO ‘episode‘@‘%‘ WITH GRANT OPTION;
如果是给所有数据库的权限,则是:
mysql>GRANT ALL PRIVILEGES ON *.* TO ‘episode‘@‘%‘ WITH GRANT OPTION;
解决Mysql ERROR 1045 (28000)“Access denied for user 'root'@'localhost'”
时间: 2024-10-08 14:59:02