In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-02-25 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Database >
Share
Shulou(Shulou.com)05/31 Report--
Today, I will talk to you about how to restore the MySQL database, many people may not know much about it. In order to make you understand better, the editor has summarized the following contents for you. I hope you can get something according to this article.
Database recovery refers to the system maintenance and management operations corresponding to backup based on backup; when the system carries out the recovery operation, it first performs some system security checks, including checking the existence of the database to be restored, whether the database changes and whether the database files are compatible, and then taking corresponding recovery measures according to the type of database backup used.
The most common techniques for establishing redundant data are data dumps and login log files. Usually in a database system, these two methods are used together. Two key issues in the design of database recovery mechanism are: first, how to establish redundant data; second, how to use these redundant data to implement database recovery.
A data dump is a process in which DBA periodically copies the entire database to tape or another disk and saves it. These alternate versions become backup copies or backup copies.
You can use LOAD DATA … INFILE statement to restore previously backed up data.
Import the previously exported data backup file file.txt into the table tb_students_copy of the database test_db, where the table structure of tb_students_copy is the same as tb_students_info.
First create the table tb_students_copy, and enter the SQL statement and the execution result as shown below.
Mysql > CREATE TABLE tb_students_copy-> LIKE tb_students_info;Query OK, 0 rows affected (0.52 sec) mysql > SELECT * FROM tb_students_copy;Empty set (0.00 sec)
The process of importing data and query table tb_students_copy is as follows.
Mysql > LOAD DATA INFILE 'C:/ProgramData/MySQL/MySQL Server 5.7 sec Records file.txt'-> INTO TABLE test_db.tb_students_copy-> FIELDS TERMINATED BY','> OPTIONALLY ENCLOSED BY'"- > LINES TERMINATED BY'?'; Query OK, 10 Deleted: 0 Skipped: 0 Warnings: 0mysql > SELECT * FROM test_db.tb_students_copy +-+ | id | name | dept_id | age | sex | height | login_date | + -+-+ | 1 | Dany | 1 | 25 | F | 2015 | 09-10 | 2 | Green | 3 | 23 | F | 2016-10-22 | 3 | Henry | 2 | 23 | M | 2015-05-31 | 4 | Jane | 1 | 22 | F | 2016-12-20 | 5 | | Jim | 1 | 24 | M | 2016 | 01-15 | | 6 | John | 2 | 21 | M | 2015 | 11-11 | | 7 | Lily | 6 | 22 | F | 2016-02-26 | 8 | Susan | 4 | 23 | F | 2015-10-01 | 9 | Thomas | 3 | 22 | M | 2016-06-07 | | | 10 | Tom | 4 | 23 | M | 165,165 | 2016-08-05 | +-+ 10 rows in set (0.00 sec) finish reading the above content | Do you know more about how to recover the MySQL database? If you want to know more knowledge or related content, please follow the industry information channel, thank you for your support.
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.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.