1、MySQL版本8.0根據(jù)官方文檔來創(chuàng)建用戶,設(shè)置密碼。然后測試登錄以及更改密碼。1.1、創(chuàng)建用戶并登陸測試在MySQL服務(wù)器上創(chuàng)建用戶。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?????我這哪里的語法錯了???
MySQL 8.0 用戶管理 更改密碼 創(chuàng)建用戶登錄 遇到很迷的問題
喵喵時光機
2019-05-10 15:59:34