一、从.sql恢复数据
①
mysql -uroot -p123456 text_db < runoob.sql
②
mysql> use abc;
mysql> source /home/abc/abc.sql
二、从备份表中恢复删除的数据
对比表差异,然后重新插入删除的数据
INSERT INTO test.customer_login_log(
`customer_id`,
`login_time`,
`login_ip`,
`login_type`
)
SELECT
bc.*
FROM
bak_test.customer_login_log bc
LEFT JOIN test.customer_login_log c ON c.customer_id = bc.customer_id
WHERE
c.customer_id IS NULL
三、从tab备份中恢复
# 导入结构
mysql> use table
mysql> source /var/lib/mysql-files/test_db/customer_login_log.sql;
# 导入数据
mysql> load data infile '/var/lib/mysql-files/test_db/customer_login_log.txt' into table customer_login_log;
四、指定时间点恢复
先决条件:
①指定时间点之前的全背
②全备到指定时间点之间的所有二进制日志