創(chuàng)建一個用戶:
create user 'oukele'@'%' identified by 'oukele';
提示下面所列出的信息的話,得刷新一下權(quán)限表
The MySQL server is running with the --skip-grant-tables option so it cannot execute this st...
步驟如下:
擴(kuò)展學(xué)習(xí)
mysql 新建用戶并賦予遠(yuǎn)程訪問權(quán)限
[root@demo /]# mysql -u root -p #登錄服務(wù)器數(shù)據(jù)庫
Enter password:123xxx
#1.創(chuàng)建一個新用戶 testuser 密碼為 testuserpass
CREATE USER 'testuser'@'localhost' IDENTIFIED BY 'testuserpass';
#2.創(chuàng)建數(shù)據(jù)庫testDB
create database testDB;
#3.執(zhí)行命令為testuser用戶添加使用testDB權(quán)限
grant all privileges on testDB.* to testuser@localhost identified by 'testuserpass';
#4.執(zhí)行命令,為testuser用戶添加遠(yuǎn)程訪問權(quán)限
GRANT ALL PRIVILEGES ON testDB.* TO 'testuser'@'%' IDENTIFIED BY 'testuserpass' WITH GRANT OPTION;
#5.刷新權(quán)限表
flush privileges;
以上就是本次知識點(diǎn)的全部內(nèi)容,更多相關(guān)知識點(diǎn)可以在下方相關(guān)文章里查找。
標(biāo)簽:鞍山 陽江 來賓 赤峰 煙臺 黃石 河北 果洛
巨人網(wǎng)絡(luò)通訊聲明:本文標(biāo)題《MySQL給新建用戶并賦予權(quán)限最簡單的方法》,本文關(guān)鍵詞 MySQL,給,新建,用戶,并,賦予,;如發(fā)現(xiàn)本文內(nèi)容存在版權(quán)問題,煩請?zhí)峁┫嚓P(guān)信息告之我們,我們將及時溝通與處理。本站內(nèi)容系統(tǒng)采集于網(wǎng)絡(luò),涉及言論、版權(quán)與本站無關(guān)。