In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-02-28 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Database >
Share
Shulou(Shulou.com)06/01 Report--
This article mainly tells you how to achieve backup and restore of MySQL database. You can check the relevant professional terms on the Internet or find some related books to supplement them. We will not dabble here, so let's go straight to the topic. I hope this article on how to achieve backup and restore of MySQL database can bring you some practical help.
Description:
In the production environment, the security of data is very important, and any loss of data may have serious consequences. Therefore, it is important to back up and restore data. The following is to backup and restore the data to do some operations.
.
.
Experimental environment: a centos7 virtual machine with MySQL database
.
.
The experimental steps are as follows:
.
.
1. First of all, a school database and info table are added to the database, and the data in the table is edited by itself.
.
.
2.
Mysqldump-u root-p school > / opt/school.sql# generates backup files under opt. This kind of backup database needs to create a new database when it is restored.
Mysql-u root-p school
< /opt/school.sql #导回数据库'' . . 3 . mysqldump -u root -p --databases school >/ opt/school02.sql# full backup of the database. Full backup is not so troublesome and can be directly imported back to
Mysql-u root-p
< /opt/school02.sql#导回数据库 . . 4 . 也可以同时备份两个数据库生成一份文件,导回后和原来相同 mysqldump -u root -p --databases school mysql >/ opt/school-mysql.sql# backs up school and mysql databases at the same time
Mysql-u root-p
< /opt/school-mysql.sql#导回数据库 . . 5 . mysqldump -u root -p school info >/ opt/info.sql# standby data sheet
Mysql-u root-p school
< /opt/info.sql #导回数据表.
.
6.
Mysqldump-u root-p-d school info > / opt/info02.sql# backup table structure
Mysql-u root-p school < / opt/info02.sql # Import table structure
.
.
7. You can check the backed-up files under opt. The red one does not count.
MySQL database how to achieve backup and restore will first tell you here, for other related issues you want to know can continue to pay attention to our industry information. Our section will capture some industry news and professional knowledge to share with you every day.
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.