Scenario Yesterday the system automatically backed up all table data of a certain database, named dbAll.sql.gz. The file is large (e.g. 40G) Today, we found a problem with a piece of data in tableA, and we need to check the changes of two records. The data of tableA needs to be retrieved from dbAll in order to compare the record. Operational Scheme 1. Import dbAll.sql.gz into the database to be compared (temporary database), and then compare tableA. Not recommended because the amount of data is too large and it is time-consuming 2. After decompressing dbAll.sql.gz, use Java code to read the CREATE statements and INSERT statements about tableA in dbAll.sql into the file tableA.sql, and then import tableA.sql into the temporary database for comparison. 3. See (not tried): mysqldump exports the entire database alldb.sql. Can I only import one table when importing? Method 1:
Method 2:
Method 3:
Method 3: Export the data of the test1 and test2 tables in the src_bake_db.sql.gz compressed file to targetdb.sql Supplementary knowledge: The mysql command line exports the first 100 records of all tables in the entire database As shown below:
Just run it directly on the command line without logging into the mysql client.
phpmyadmin export php script:
The above MySQL implementation of importing only a specified table from the sql file of exported data is all the content that the editor shares with you. I hope it can give you a reference. I also hope that you will support 123WORDPRESS.COM. You may also be interested in:
|
<<: Vue implements small form validation function
>>: Detailed explanation of the Docker deployment tutorial for Jenkins beginners
Preparation 1. Start the virtual machine 2. git t...
Preface Although some love in this world has a pr...
Preface When I was browsing Xianyu today, I notic...
Computed properties Sometimes we put too much log...
Table of contents 1minio is simple 2 Docker build...
Table of contents 1. Function Binding 2. With par...
I designed and customized a navigation bar with a...
Table of contents 1. Basic concepts and basic com...
Copy code The code is as follows: li {width:300px...
1. nohup Run the program in a way that ignores th...
When talking about this issue, some people may ask...
0. When I made this document, it was around Decem...
Table of contents Preface What situations can cau...
Demand scenario: The boss asked me to use the cra...
Forwarding between two different servers Enable p...