重新创建一个数据库
打开最近一次完整备份到你要恢复点的binlog,前提是打开log-bin
根据时间点,执行binlog日志,恢复到你所要的恢复点
binlog *** 作方法
mysql>CREATE DATABASE sakila
mysql>USE sakila
mysql>CREATE TABLE actor (
actor_id SMALLINT UNSIGNED NOT NULL AUTO_INCREMENT,
first_name VARCHAR(45) NOT NULL,
last_name VARCHAR(45) NOT NULL,
last_update TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
PRIMARY KEY (actor_id),
KEY idx_actor_last_name (last_name)
)ENGINE=InnoDB DEFAULT CHARSET=utf8
ALTER TABLE {库名}.{表名} DISCARD TABLESPACE
例:
mysql>ALTER TABLE sakila.actor DISCARD TABLESPACE
cp /backup_directory/actor.ibd path/to/mysql-5.7/data/sakila/
ALTER TABLE {库名}.{表名} IMPORT TABLESPACESHOW WARNINGS
例:
mysql>ALTER TABLE sakila.actor IMPORT TABLESPACESHOW WARNINGS
Query OK, 0 rows affected, 1 warning (0.15 sec)
Warning | 1810 | InnoDB: IO Read error: (2, No such file or directory)
Error opening './sakila/actor.cfg', will attempt to import
without schema verification
mysql>SELECT COUNT(*) FROM sakila.actor
+----------+
| count(*) |
+----------+
| 200 |
+----------+
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)