MySQL 8.0:check the manual that corresponds to your MySQL server version for the right syntax to use near 'identified by 'password'' at line 1


【參考文章】:mysql 8.0.11 中使用 grant ... identified by 時 error 1064 near 'identified by '密碼'' at line 1

1. 問題原因

  MySQL 8.0 版本之后語法有更新,創建用戶語句和權限修改語句需要分開執行

2. 解決方法

  創建賬戶:create user '用戶名'@'訪問主機' identified by '密碼';

  權限修改:grant 權限列表 on 數據庫 to '用戶名'@'訪問主機' ;(修改權限時在后面加with grant option)


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2026 CODEPRJ.COM