场景
准备
curl -s http://get.dbsake.net > dbsake chmod u+x dbsake ./dbsake --version dbsake, version 2.1.0 9525896
开始恢复
[root@ecs-xxxxxx ~]# ./dbsake frmdump tags.frm ---- Table structure for table `tags`-- Created with MySQL Version 5.7.28--CREATE TABLE `tags` ( `id` int(11) NOT NULL AUTO_INCREMENT, `create_time` datetime(6) DEFAULT NULL, `update_time` datetime(6) DEFAULT NULL, `name` varchar(255) NOT NULL, `slug` varchar(50) NOT NULL, `slug_name` varchar(255) DEFAULT NULL, `thumbnail` varchar(1023) DEFAULT NULL, PRIMARY KEY (`id`), UNIQUE KEY `UK_sn0d91hxu700qcw0n4pebp5vc` (`slug`), KEY `tags_name` (`name`)) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
CREATE TABLE tags ........;
ALTER TABLE tags DISCARD TABLESPACE;
ctrl+C -> ctrl + V------>到目标数据库文件夹
cp tags.ibd /var/lib/mysql/<database_name> cd /var/lib/mysql/<database_name>chown mysql:mysql tags.ibd
ALTER TABLE tags IMPORT TABLESPACE;
打开表试试吧,中间没啥错误就恢复成功了
有啥问题留言哦,感谢阅读,给个赞谢谢啦
#程序员##MySQL##数据恢复#
声明:本站部分文章及图片源自用户投稿,如本站任何资料有侵权请您尽早请联系jinwei@zod.com.cn进行处理,非常感谢!