在看《Tom與Java Web開發技術詳解》第八章。本章開頭要求在MySQL資料庫中創建一個新用戶,步驟如下:
① 在命令列視窗輸入:mysql -u root -p。
② 系統提示輸入密碼后再輸入MySQL的root用戶密碼。
③ 進入mysql資料庫,使用如下陳述句創建一個用戶名和密碼分別為dbuser和1234的新用戶:
use mysql;
grant all privileges on *.* to dbuser@localhost
identified by '1234' with grant option;
執行第③步的最后一句命令后報錯。錯誤資訊如下:
ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'identified by '1234' with grant option' at line 2
uj5u.com熱心網友回復:
看版本,要是Mysql 8.0+ 已經無法用這種方法添加用戶應該 create user dbuser@localhost identified by '1234';
grant all privileges on *.* to dbuser@localhost with grant option;
轉載請註明出處,本文鏈接:https://www.uj5u.com/shujuku/237824.html
標籤:基礎類
上一篇:LD3320模塊和STM32F103單片機串口通信怎么做呀?有人能教教我嗎?
下一篇:小白咨詢
