MySQL学习笔记--数据备份与恢复

数据备份:
mysqldump --user=user --password=pwd --result-file=data.sql --where=
"where condition" database_name table_name

恢复:从命令行或者mysql client导入

查看mysql日志:
mysqlbinlog log_path
从日志恢复数据:
mysqlbinlog logs | mysql


数据写入文件
SELECT column_a, column_b FROM table_a
INTO FILE 'data.csv' FIELDS TERMINATED BY ',';

数据从文件导入
LOAD DATA INFILE 'data.scv'
INTO TABLE table_a FIELDS TERMINATED BY ',';

你可能感兴趣的:(sql,mysql)