Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

Introduction to transferable tablespaces of mysql

2025-01-16 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Database >

Share

Shulou(Shulou.com)05/31 Report--

This article mainly explains "the introduction of transportable table space of mysql". The content of the explanation is simple and clear, and it is easy to learn and understand. Please follow the editor's train of thought to study and learn "introduction of transportable table space of mysql".

Discard tablespaces in the library to be imported

Alter table test discard tablespace

Backup on the source database, with a read lock added to this operation.

Cfg records the information of the original table, and we copy the cfg and ibd files to the library where we used to do discard. Then release the table of the source library, unlock tables

Then import the tablespaces from cp in the library to be imported. (of course, my two watches are not the same, this is also stupid behavior, wow ha ha)

Of course, there is a record of information in error.log when it is imported.

And 5.7 you can export a partition in the partition table.

Mysql > show create table employees1

CREATE TABLE `employees1` (

`emp_ no` int (11) NOT NULL

`birth_ date` date NOT NULL

`first_ name` varchar (14) NOT NULL

`last_ name` varchar (16) NOT NULL

PRIMARY KEY (`emp_ no`)

) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4

/ * 50100 PARTITION BY HASH (emp_no)

PARTITIONS 4 * / |

Similarly, flush table employees1 for export; generates cfg files

Also copy past partitions.

Execute in the imported library

Alter table employees discard partition p0 tablespace

......

Alter table employees import partition p0 tablespace

Thank you for your reading, the above is the content of "introduction to transportable tablespaces of mysql". After the study of this article, I believe you have a deeper understanding of the introduction of transportable tablespaces of mysql, and the specific use needs to be verified in practice. Here is, the editor will push for you more related knowledge points of the article, welcome to follow!

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Database

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report