因為翰x要移機,所以要把db 上的資料轉出來,不過因為用mysql db < db.sql 常常會出他媽的鬼問題,很杜爛!!! 所以單純把資料dump 成 text file 會是一個比較好的方式,然後再透過mysqlimport 或是LOAD DATA INFILE。 我寫了兩個小小的scripts 就是dump和 restore 有須要的人請自行服用 ::-p: 1.import_db.sh db_dir=$1 db=$2 for file in `find $1 -type f -depth 1 | egrep txt` do table=`echo $file |cut -d “/” -f 5|cut -d “.” -f 1` echo ‘import data to ‘$table’ finished ‘ /usr/local/bin/mysql -u [...]