In addition to Weibo, there is also WeChat
Please pay attention

WeChat public account
Shulou
2025-11-09 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Database >
Share
Shulou(Shulou.com)05/31 Report--
In this issue, the editor will bring you about how to restore the designated library in the mysqldump complete. The article is rich in content and analyzes and narrates it from a professional point of view. I hope you can get something after reading this article.
There are many ways to recover the specified data from a complete data. you can extract the data database name and table name from the complete data file by special methods, and you can also restore the specified data by a fully specified library name. this method is simple and fast, this method will restore unwanted libraries, but will not restore data.
The process is as follows:
1. Check the database before it is backed up.
MariaDB [(none)] > show databases
+-+
| | Database |
+-+
| | bb |
| | cc |
| | dd |
| | grafana |
| | information_schema |
| | mysql |
| | performance_schema |
| | test |
+-+
MariaDB [(none)] > use grafana
MariaDB [grafana] > show tables
+-+
| | Tables_in_grafana |
+-+
| | api_key |
| | dashboard |
| | dashboard_snapshot |
| | dashboard_tag |
| | data_source |
| | migration_log |
| | org |
| | org_user |
| | star |
| | user |
+-+
10 rows in set (0.00 sec)
MariaDB [test] > select * from aa
+-+ +
| | id | s_num |
+-+ +
| | 1 | 1 |
| | 2 | 2 |
| | 3 | 33331 | |
| | 4 | 33334 |
+-+ +
4 rows in set (0.00 sec)
2. The data mysqldump method of fully preparing an instance
/ usr/local/mysql/bin/mysqldump-S / tmp/mysql3306.sock-p-- all-databases > aa.sql
3. Delete the business library:
Drop database xxxx
4. Restore the specified library. When restoring the specified library, you need to add the restored library to the library, otherwise you will be prompted ERROR 1049 (42000): Unknown database 'test'.
MariaDB [(none)] > create database test
Query OK, 1 row affected (0.00 sec)
MariaDB [(none)] > show databases
+-+
| | Database |
+-+
| | information_schema |
| | mysql |
| | performance_schema |
| | test |
+-+
4 rows in set (0.00 sec)
5. Restore the specified library
/ usr/local/mysql/bin/mysql-S / tmp/mysql3306.sock-p-- one-database test
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.

The market share of Chrome browser on the desktop has exceeded 70%, and users are complaining about
The world's first 2nm mobile chip: Samsung Exynos 2600 is ready for mass production.According to a r
A US federal judge has ruled that Google can keep its Chrome browser, but it will be prohibited from
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope





About us Contact us Product review car news thenatureplanet
More Form oMedia: AutoTimes. Bestcoffee. SL News. Jarebook. Coffee Hunters. Sundaily. Modezone. NNB. Coffee. Game News. FrontStreet. GGAMEN
© 2024 shulou.com SLNews company. All rights reserved.