当前位置:网站首页>How to modify and add fields when MySQL table data is large
How to modify and add fields when MySQL table data is large
2022-06-30 02:46:00 【Yisu cloud】
Mysql How to modify and add fields when the table data is large
This article mainly introduces Mysql How to modify and add fields when the table data is large , The content is detailed and easy to understand , The operation is simple and fast , It has certain reference value , I believe that after reading this article Mysql When the table data is relatively large, you will gain some experience in how to modify and add fields , Let's have a look .
Preface
If a table is in later maintenance , Find that you need to add fields to meet the current needs , But the amount of data is huge, there are millions or even tens of millions of data , How to modify table fields .
Directly execute using alter The statement is certainly unrealistic , This involves operations such as locking the table and reconstructing the table structure , Suppose there are other threads running at this time , I can't change it for a day .
Here is a simple way to sort out
1、 Create a temporary table against the table structure to be operated
CREATE TABLE product_copy LIKE product;
2、 Change the table structure to be modified to the temporary table
3、 Export table product data , And import to the zero hour table product_copy
4、 Use RENAME Statement replacement table name
RENAME TABLE product TO product_bak, product_copy TO product;
But when the amount of data is too large , Exporting and importing also takes some time , And the data is error prone , It is recommended to use datagrip Import and export tools for , perhaps idea Data source plug-in for , Best use csv File to import and export .
1、 Right click the table name and select import data

2、 In the import interface, you can clearly see the corresponding relationship of fields , If there is a problem, you can adjust it directly , What you see is what you get

3、 If the header is displayed when exporting , You can also right-click the first row to mark it as a header , It is more convenient to see the corresponding data

About “Mysql How to modify and add fields when the table data is large ” That's all for this article , Thank you for reading ! I'm sure you're right “Mysql How to modify and add fields when the table data is large ” Knowledge has a certain understanding , If you want to learn more , Welcome to the Yisu cloud industry information channel .
边栏推荐
- Global and Chinese market of wind energy equipment logistics 2022-2028: Research Report on technology, participants, trends, market size and share
- HTA introductory basic tutorial | GUI interface of vbs script HTA concise tutorial, with complete course and interface beautification
- SiteLock九个常见问题
- Global and Chinese market of subscription revenue management software 2022-2028: Research Report on technology, participants, trends, market size and share
- Steam elements hidden in science and Technology Education
- Bucket sort
- Network neuroscience -- a review of network Neuroscience
- 2. < tag dynamic programming and 0-1 knapsack problem > lt.416 Split equal sum subset + lt.1049 Weight of the last stone II
- Digicert、Sectigo、Globalsign代码签名证书的区别
- Global and Chinese markets of liquid optical waveguides 2022-2028: Research Report on technology, participants, trends, market size and share
猜你喜欢

What is an X.509 certificate? 10. 509 certificate working principle and application?

2.8 【 weight of complete binary tree 】

Bubble sort

学术汇报(academic presentation)/PPT应该怎么做?

Playful palette: an interactive parametric color mixer for artists

如何在 JupyterLab 中把 ipykernel 切换到不同的 conda 虚拟环境?

Digicert、Sectigo、Globalsign代码签名证书的区别

Bucket sort

Recursion frog jumping steps problem

Linear algebra Chapter 3 summary of vector and vector space knowledge points (Jeff's self perception)
随机推荐
How to switch ipykernel to a different CONDA virtual environment in jupyterlab?
What is an X.509 certificate? 10. 509 certificate working principle and application?
怎样的外汇交易平台是有监管的,是安全的?
Intel-Hex , Motorola S-Record 格式详细解析
选购通配符SSL证书注意事项
Five cheapest wildcard SSL certificate brands
Raki's notes on reading paper: discontinuous named entity recognition as maximum clique discovery
Unity timeline data binding
Raki's notes on reading paper: named entity recognition as dependency parsing
Global and Chinese market of relay lens 2022-2028: Research Report on technology, participants, trends, market size and share
学术汇报(academic presentation)/PPT应该怎么做?
What about punctuation in the first column of unity text
Global and Chinese markets of liquid optical waveguides 2022-2028: Research Report on technology, participants, trends, market size and share
迅为恩智浦iTOP-IMX6开发平台
NPDP产品经理国际认证考试报名有什么要求?
How to prevent duplicate submission under concurrent requests
【npm】解决使用npm安装TypeORM的报错问题
Creating exquisite skills in maker Education
LeetCode 3. 无重复字符的最长子串
Série de tutoriels cmake - 02 - génération de binaires à l'aide du Code cmake