轉載——mysql 創建新用戶 并賦予權限 1、以管理員身份登錄mysql mysql -u root -p 2、選擇mysql數據庫 use mysql 3、創建用戶并設定密碼 create user 'testuser'@'localhost' identified by 'testpassword' 遠程訪問用戶: create user 'testuser'@'%' ident
轉載——mysql 創建新用戶 并賦予權限mysql -u root -p
2、選擇mysql數據庫
use mysql
3、創建用戶并設定密碼
create user 'testuser'@'localhost' identified by 'testpassword'
遠程訪問用戶:
create user 'testuser'@'%' identified by 'testpassword'
4、使操作生效
flush privileges
5、為用戶創建數據庫
create database testdb
6、為用戶賦予操作數據庫testdb的所有權限
grant all privileges on testdb.* to 'testuser'@'localhost' identified by 'testpassword'
遠程訪問權限用戶:
grant all privileges on testdb.* to 'testuser'@'%' identified by 'testpassword'
7、使操作生效
flush privileges
8、用新用戶登錄
mysql -u test -p
聲明:本網頁內容旨在傳播知識,若有侵權等問題請及時與本網聯系,我們將在第一時間刪除處理。TEL:177 7030 7066 E-MAIL:11247931@qq.com