Unix/bsd/linux

From Heterotopias Wiki

Jump to: navigation, search

mysql

Mysql migrate/backup 指令參考 http://wiki.dreamhost.com/index.php/Migrate_MySQL

  • mysql 匯入資料指令
mysql -h mysql.example.com -u username -p password newdbname < outfile.sql
mysql -u heterotopias -p -h mysql.heterotopias.net heterotopias < yourfiledump
  • 搬移資料庫
mysqldump -h oldhost -u oldusername -poldpassword olddbname | mysql -h newhost -u newusername -pnewpassword newdbname
  • Getting a Backup From the Shell
mysqldump --opt -u username -ppassword -h yourMySQLHostname dbname > output.sql

Finding Causes of Heavy Usage

  • find hardest hits to sites, go user/logs/domain/http
 tail -10000 access.log| awk '{print $1}' | sort | uniq -c |sort -n
<Limit GET HEAD POST>
order allow,deny
deny from 127.0.0.1
allow from all
</LIMIT>
  • User resource reporting, GO Http://mysite.com/stats/resources

robots.txt

Personal tools