时间:2021-07-01 10:21:17 帮助过:13人阅读
单库备份:
表的备份:
多库备份:
对所有库的备份:
二、恢复逻辑备份
三,表的导出和导入:
SELECT... INTO OUTFILE 导出文本文件 示例: mysql> SELECT * FROM school.student1 INTO OUTFILE ‘student1.txt‘ FIELDS TERMINATED BY ‘,‘ //定义字段分隔符 OPTIONALLY ENCLOSED BY ‘”‘ //定义字符串使用什么符号括起来 LINES TERMINATED BY ‘\n‘ ; //定义换行符 mysql 命令导出文本文件 示例: # mysql -u root -p123 -e ‘select * from student1.school‘ > /tmp/student1.txt # mysql -u root -p123 --xml -e ‘select * from student1.school‘ > /tmp/student1.xml # mysql -u root -p123 --html -e ‘select * from student1.school‘ > /tmp/student1.html LOAD DATA INFILE 导入文本文件 mysql> DELETE FROM student1; mysql> LOAD DATA INFILE ‘/tmp/student1.txt‘ INTO TABLE school.student1 FIELDS TERMINATED BY ‘,‘ OPTIONALLY ENCLOSED BY ‘”‘ LINES TERMINATED BY ‘\n‘;
mysqls
标签:mys ted p12 小型 style nbsp school closed sch