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

我用 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讲师

répondre à tous(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

Derniers téléchargements
Plus>
effets Web
Code source du site Web
Matériel du site Web
Modèle frontal
À propos de nous Clause de non-responsabilité Sitemap
Site Web PHP chinois:Formation PHP en ligne sur le bien-être public,Aidez les apprenants PHP à grandir rapidement!