1、MySQL版本8.0根据官方文档来创建用户,设置密码。然后测试登录以及更改密码。1.1、创建用户并登陆测试在MySQL服务器上创建用户。mysql>createuser'aplan'@'%'identifiedby'Aplan123@';QueryOK,0rowsaffected(0.00sec)mysql>flushprivileges;QueryOK,0rowsaffected(0.00sec)mysql>grantallonaplan.*to'aplan'@'%';QueryOK,0rowsaffected(0.15sec)mysql>mysql>mysql>flushprivileges;QueryOK,0rowsaffected(0.00sec)然后使用用户登录MySQL测试[root@testzhiwei]#/usr/local/mysql/bin/mysql-uaplan-pAplan123@Warning:Usingapasswordonthecommandlineinterfacecanbeinsecure.ERROR1045(28000):Accessdeniedforuser'aplan'@'localhost'(usingpassword:YES)[root@testzhiwei]#[root@testzhiwei]#[root@testzhiwei]#[root@testzhiwei]#/usr/local/mysql/bin/mysql-uaplan-pEnterpassword:ERROR1045(28000):Accessdeniedforuser'aplan'@'localhost'(usingpassword:YES)无法登录。1.2、更改用户密码mysql>ALTERUSER'aplan'@'%'IDENTIFIEDBY'password';ERROR1064(42000):YouhaveanerrorinyourSQLsyntax;checkthemanualthatcorrespondstoyourMySQLserverversionfortherightsyntaxtousenear'IDENTIFIEDBY'password''atline1?????我这哪里的语法错了???
慕沐林林
慕仙森
相关分类