关于mysql grant权限语句的报错问题
PHP中文网
PHP中文网 2017-04-17 13:38:43
0
4
1009

我用 mysql -u root -p
登陆进去敲入命令
grant all on . to ja identified by '123' with grant option;
提示Query OK, 0 rows affected (0.00 sec)

退出后,用刚新建的ja账号登陆
mysql -u ja -p

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

请问为啥?

PHP中文网
PHP中文网

认证高级PHP讲师

全部回覆(4)
大家讲道理

需要刷新系統權限表[flush privilege] 該使用者才能生效登入

flush privileges;
迷茫

如果是grant all on . to ja@localhost ...
的話,應該就不會報錯了

黄舟

grant的指令格式為:mysql> grant all on . to 'user'@'ip' identified by 'password' with grant option;

刘奇

grant all on . to 'ja'@'%' identified by '123' with grant option;
flush privileges;
quit;
然後再登入看看:mysql -u ja -p 123

熱門教學
更多>
最新下載
更多>
網站特效
網站源碼
網站素材
前端模板
關於我們 免責聲明 Sitemap
PHP中文網:公益線上PHP培訓,幫助PHP學習者快速成長!