MySQL Workbench下載地址:https://downloads.mysql.com/archives/workbench/
下載安裝成功后兼呵,打開應(yīng)用程序MySQL Workbench
點(diǎn)擊“Local instance 3306”連接數(shù)據(jù)庫,輸入root用戶新密碼:
新建數(shù)據(jù)庫并授權(quán)給用戶
點(diǎn)擊左側(cè)菜單的“Users and Privileges”按鈕犯戏,輸入新用戶的用戶名(framework_user)筐骇,連接地址(%表示從任何地址)上岗,密碼和確認(rèn)密碼鞍盗,點(diǎn)擊“Apply”按鈕:
新增成功之后,發(fā)現(xiàn)用戶列表多了framework_user這個(gè)用戶:
在左側(cè)“SCHEMAS”區(qū)域空白處右鍵點(diǎn)擊音瓷,在彈出的菜單中選擇“Create Schemas”:
輸入數(shù)據(jù)庫名字“framework”,選擇編碼格式“utf8 - default collation”夹抗,點(diǎn)擊“Apply”按鈕新建數(shù)據(jù)庫:
系統(tǒng)生成創(chuàng)建數(shù)據(jù)語句绳慎,點(diǎn)擊“Apply”按鈕:
“Schemas”列表多了“framework”這個(gè)數(shù)據(jù)庫:
數(shù)據(jù)庫創(chuàng)建成功,點(diǎn)擊“Close”按鈕:
Mysql Workbench左側(cè)“Schemas”列表多了“framework”這個(gè)數(shù)據(jù)庫:
點(diǎn)擊Mysql Workbench左側(cè)“Users and Privileges”,在“User Accounts”列表中選擇“framework_user”用戶漠烧,點(diǎn)擊“Schemas Privileges”按鈕:
點(diǎn)擊“Add Entry...”按鈕杏愤,選擇“framework”數(shù)據(jù)庫,點(diǎn)擊“OK”按鈕:
點(diǎn)擊“Select "ALL"”按鈕已脓,選擇所有權(quán)限珊楼,點(diǎn)擊“Apply”按鈕:
在權(quán)限信息框中多了授權(quán)信息:
自此,framework_user擁有了對(duì)framework數(shù)據(jù)進(jìn)行所有操作的權(quán)限度液。
參考文章鏈接https://blog.csdn.net/sun_wangdong/article/details/78404282