mysql管理相关命令
1、备份数据
mysqldump -u root -p oneplus_magento >/tmp/magento.sql
只导结构
mysqldump --opt -u root -p -d oneplus_magento >/tmp/magento.sql
2、导出binlog中的修改记录到sql文件
mysqlbinlog --start-datetime='2014-11-26 00:00:00' mysql-bin-log.000004 > my.sql
3、创建指定字符集的数据库
create database test DEFAULT CHARACTER SET utf8 COLLATE utf8_general_ci;
用mysql命令导出数据
mysql -u oneplusaws -h 127.0.0.1 -p -e "use test;select * from tbl_tmp where id=1" >/tmp/tt.csv

浙公网安备 33010602011771号