時(shí)間:2015/6/28來源:IT貓撲網(wǎng)作者:網(wǎng)管聯(lián)盟我要評論(0)
# vi mysqlusers.txt
create database dataname;
grant all privileges on dataname.* to username@localhost identified by ‘password‘;
flush privileges;
# /usr/local/mysql/bin/mysql -u root -p password < mysqlusers.txt
藍(lán)色斜體部分為對應(yīng)的用戶名和密碼,添加多個(gè)用戶及數(shù)據(jù)庫,只需要復(fù)制中間部分代碼并修改對應(yīng)的位置即可,如:
create database dataname1;
grant all privileges on dataname1.* to username1>@localhost" identified by ‘password‘;
flush privileges;
create database dataname2;
grant all privileges on dataname2.* to username2>@localhost" identified by ‘password‘;
flush privileges;
關(guān)鍵詞標(biāo)簽:mysql,數(shù)據(jù)庫
相關(guān)閱讀
熱門文章 10款MySQL數(shù)據(jù)庫客戶端圖形界面管理工具推薦MySQL常用維護(hù)管理工具Linux VPS/服務(wù)器上輕松導(dǎo)入、導(dǎo)出MySQL數(shù)據(jù)MySQL復(fù)制的概述、安裝、故障、技巧、工具
人氣排行 MySQL數(shù)據(jù)庫啟動(dòng)失敗1067進(jìn)程意外終止的解決辦法總結(jié)Mysql 1045錯(cuò)誤解決辦法10款MySQL數(shù)據(jù)庫客戶端圖形界面管理工具推薦MySQL服務(wù)器進(jìn)程CPU占用100%解決辦法MySQL導(dǎo)出導(dǎo)入命令的用例MySQL無法啟動(dòng)、無法停止各種解決方法總結(jié)三種常用的MySQL建表語句Mysql清空表的實(shí)現(xiàn)方法