MySQL table backup

MySQL table backup 表复制,表空间物理拷贝

2017年医疗系统 HIS LIS PACS Oracle 表与表空间

1)进入MySQL执行操作命令

D:\mysql-8.0.30-winx64\data\further

2)切换到操作系统,复制文件

3)再次,第二次进入MySQL执行操作命令

4)查询备份结果

复制代码
Microsoft Windows [版本 10.0.19045.6216]
(c) Microsoft Corporation。保留所有权利。

C:\Users\Administrator>d:

D:\>
D:\>cd D:\mysql-8.0.30-winx64\bin

D:\mysql-8.0.30-winx64\bin>
D:\mysql-8.0.30-winx64\bin>
D:\mysql-8.0.30-winx64\bin>mysql -uroot -p
Enter password: ******
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 23
Server version: 8.0.30 MySQL Community Server - GPL

Copyright (c) 2000, 2022, Oracle and/or its affiliates.

Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective
owners.

Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.

mysql>
mysql>
mysql>
mysql> show databases;
+--------------------+
| Database           |
+--------------------+
| activiti           |
| further            |
| information_schema |
| mysql              |
| performance_schema |
+--------------------+
5 rows in set (0.00 sec)

mysql>
mysql>
mysql>
mysql>
mysql> use further;
Database changed
mysql>
mysql>
mysql>
mysql> create table sys_region_village_backup like sys_region_village;
Query OK, 0 rows affected (0.03 sec)

mysql>
mysql>
mysql>
mysql> alter table sys_region_village_backup discard tablespace;
Query OK, 0 rows affected (0.01 sec)

mysql>
mysql>
mysql> flush tables sys_region_village for export;
Query OK, 0 rows affected (0.00 sec)

mysql>
mysql>
mysql>
mysql> exit;
Bye

D:\mysql-8.0.30-winx64\bin>
D:\mysql-8.0.30-winx64\bin>
D:\mysql-8.0.30-winx64\bin>cd D:\mysql-8.0.30-winx64\data\further

D:\mysql-8.0.30-winx64\data\further>
D:\mysql-8.0.30-winx64\data\further>
D:\mysql-8.0.30-winx64\data\further>
D:\mysql-8.0.30-winx64\data\further>
D:\mysql-8.0.30-winx64\data\further>copy sys_region_village.ibd sys_region_village_backup.ibd
已复制         1 个文件。

D:\mysql-8.0.30-winx64\data\further>
D:\mysql-8.0.30-winx64\data\further>
D:\mysql-8.0.30-winx64\data\further>
D:\mysql-8.0.30-winx64\data\further>
D:\mysql-8.0.30-winx64\data\further>cd D:\mysql-8.0.30-winx64\bin

D:\mysql-8.0.30-winx64\bin>
D:\mysql-8.0.30-winx64\bin>
D:\mysql-8.0.30-winx64\bin>
D:\mysql-8.0.30-winx64\bin>mysql -uroot -p
Enter password: ******
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 24
Server version: 8.0.30 MySQL Community Server - GPL

Copyright (c) 2000, 2022, Oracle and/or its affiliates.

Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective
owners.

Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.

mysql>
mysql>
mysql>
mysql>
mysql> show databases;
+--------------------+
| Database           |
+--------------------+
| activiti           |
| further            |
| information_schema |
| mysql              |
| performance_schema |
+--------------------+
5 rows in set (0.00 sec)

mysql>
mysql>
mysql> use further
Database changed
mysql>
mysql>
mysql> unlock tables;
Query OK, 0 rows affected (0.00 sec)

mysql>
mysql>
mysql>
mysql> alter table sys_region_village_backup import tablespace;
Query OK, 0 rows affected, 1 warning (1.16 sec)

mysql>
mysql>
mysql>
mysql>
mysql> select count(1) from sys_region_village_backup;
+----------+
| count(1) |
+----------+
|   620573 |
+----------+
1 row in set (0.15 sec)

mysql>
mysql> select count(1) from sys_region_village;
+----------+
| count(1) |
+----------+
|   620573 |
+----------+
1 row in set (0.33 sec)

mysql>
相关推荐
それども21 小时前
DELETE 和 TRUNCATE TABLE区别
java·数据库·mysql
wenha21 小时前
数据库隔离级别
数据库·mysql·sqlserver·隔离级别
Edward111111111 天前
4.27mysql ,数据库,数据源
数据库·mysql
神仙别闹1 天前
基于Python(Django)+MySQL 实现(Web)SQL智能检测系统的设计与实现
python·mysql·django
tongyiixiaohuang1 天前
技术案例分享:金蝶云星空客户数据同步到MySQL的实现
android·数据库·mysql
运维全栈笔记1 天前
K8S部署WordPress+MySQL:模块化YAML配置详解
服务器·mysql·docker·云原生·容器·kubernetes·服务发现
Rick19931 天前
mysql 慢查询如何快速定位
数据库·mysql
Vect__1 天前
MySQL的数据类型和约束
android·数据库·mysql
ChoSeitaku1 天前
5.MySQL表的约束|空属性|默认值|列描述|主键|自增长|唯一键|外键
android·数据库·mysql
A_aspectJ1 天前
【Java基础开发】基于 Java Swing +MySQL + JDBC 版实现图书管理系统
java·开发语言·mysql