2016年4月24日 星期日

MariaDB 帳號建立與安全性管理指令


【登入】

mysql -u 帳號 -p


【遠端登入】

mysql -h 遠端位置 -u 帳號 -p



【本機登入】

sudo mysql -u root



在mysql>下

【查帳號】

select user from user;

【查詢帳號權限】

show grants for 帳號;

show grants for 'root'@'localhost'


【建立帳號並本機登入】

create user 帳號 identified by '密碼'


【建立帳號並可遠端登入】

create user '[USER_NAME]'@'%' 帳號 identified by '密碼';

create user 'myuser'@'%' identified by 'password';


【啓用root本機登入權限】

GRANT ALL PRIVILEGES ON *.* TO 'root'@'localhost' IDENTIFIED BY '<PW>';

FLUSH PRIVILEGES;


【給該帳號和root 一樣的權限】

grant all on *.* to 帳號



【給帳號某個db的權限】

grant all on [DB_NAME].* to [帳號]








1 則留言:

  1. Wynn Resorts, Limited Company Profile | jtmhub.com
    Find contact information for 출장안마 Wynn Resorts, Limited of Las Vegas, 시흥 출장마사지 NV. Get company research, competitor information, 안성 출장마사지 contact details & financial data for Wynn 안산 출장마사지 Resorts, Headquarters: Las Vegas, NVPhone: +1 702 구미 출장안마 770 624

    回覆刪除

熱門文章