mysql經由過程文檔讀取並履行敕令之疾速為mysql添加多用戶和數據庫技能。本站提示廣大學習愛好者:(mysql經由過程文檔讀取並履行敕令之疾速為mysql添加多用戶和數據庫技能)文章只能為提供參考,不一定能成為您想要的結果。以下是mysql經由過程文檔讀取並履行敕令之疾速為mysql添加多用戶和數據庫技能正文
# 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
藍色斜體部門為對應的用戶名和暗碼,添加多個用戶及數據庫,只須要復制中央部門代碼並修正對應的地位便可,如:
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;
以上內容給年夜家分享了mysql經由過程文檔讀取並履行敕令之疾速為mysql添加多用戶和數據庫技能,願望年夜家愛好,關於數據庫內容請連續存眷本站,本站天天都有新的內容更新