Warning: include(/home/blog66rr/public_html/wp-content/plugins/hyper-cache/cache.php): failed to open stream: No such file or directory in /home/blog66rr/public_html/wp-content/advanced-cache.php on line 24

Warning: include(/home/blog66rr/public_html/wp-content/plugins/hyper-cache/cache.php): failed to open stream: No such file or directory in /home/blog66rr/public_html/wp-content/advanced-cache.php on line 24

Warning: include(): Failed opening '/home/blog66rr/public_html/wp-content/plugins/hyper-cache/cache.php' for inclusion (include_path='.:/opt/cpanel/ea-php70/root/usr/share/pear') in /home/blog66rr/public_html/wp-content/advanced-cache.php on line 24
mysql指令速記 – unethost無限空間虛擬主機 技術分享部落格

mysql指令速記

我實在是覺得透過 cpanel來增新mysql user有點缺乏效率。
還是不用指令不爽呀… ( 以下指令需要以root身分登入mysql )

(1) 新增使用者
create user ‘使用者名’@’localhost’ identified by ‘密碼’;

(2) 新增資料庫
create database 資料庫名;

(3) 使用資料庫
use 資料庫名;

(4) 設定權限  ( 對某個資料庫的所有tables 設定給某個user )
grant ALL PRIVILEGES on 資料庫名.* to ‘使用者名’@’localhost’;

(5) 砍掉資料庫
drop database 資料庫名;

(6) 砍掉使用者
drop user ‘使用者名’@’localhost’;