MySQL 常用指令
*授權使用者權限
Shell>mysql -u root -p
password:XXXXX
mysql>grant all privileges on *.* to username@"%" identified by 'password' with grant option;
====>可以由遠端來存取。
或
mysql>grant all privileges on *.* to username@localhost identified by 'password' with grant option;
====>可以由本機來存取。
ps:授權完畢必須用mysqladmin reload來使授權生效。
*變更使用者密碼
mysql> SET PASSWORD FOR username@"%" = PASSWORD('password');
mysql> SET PASSWORD FOR username@localhost = PASSWORD('password');
*備份MySQL
mysqldump --all-databases --complete-insert --add-drop-table --user=username --password=password
張貼留言