IT貓撲網(wǎng):您身邊最放心的安全下載站! 最新更新|軟件分類|軟件專題|手機(jī)版|論壇轉(zhuǎn)貼|軟件發(fā)布

您當(dāng)前所在位置:首頁數(shù)據(jù)庫MYSQL → mysql通過文檔讀取并執(zhí)行命令–快速為mysql添加多用戶和數(shù)據(jù)庫

mysql通過文檔讀取并執(zhí)行命令–快速為mysql添加多用戶和數(shù)據(jù)庫

時間: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)的用戶名和密碼,添加多個用戶及數(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)閱讀

文章評論
發(fā)表評論

熱門文章 10款MySQL數(shù)據(jù)庫客戶端圖形界面管理工具推薦10款MySQL數(shù)據(jù)庫客戶端圖形界面管理工具推薦MySQL常用維護(hù)管理工具MySQL常用維護(hù)管理工具Linux VPS/服務(wù)器上輕松導(dǎo)入、導(dǎo)出MySQL數(shù)據(jù)Linux VPS/服務(wù)器上輕松導(dǎo)入、導(dǎo)出MySQL數(shù)據(jù)MySQL復(fù)制的概述、安裝、故障、技巧、工具MySQL復(fù)制的概述、安裝、故障、技巧、工具

相關(guān)下載

人氣排行 MySQL數(shù)據(jù)庫啟動失敗1067進(jìn)程意外終止的解決辦法總結(jié)Mysql 1045錯誤解決辦法10款MySQL數(shù)據(jù)庫客戶端圖形界面管理工具推薦MySQL服務(wù)器進(jìn)程CPU占用100%解決辦法MySQL導(dǎo)出導(dǎo)入命令的用例MySQL無法啟動、無法停止各種解決方法總結(jié)三種常用的MySQL建表語句Mysql清空表的實現(xiàn)方法