In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-01-16 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 achieve backup and restore in the Mysql database. The article is rich in content and analyzes and describes for you from a professional point of view. I hope you can get something after reading this article.
1. Commands for backing up MySQL database
Double-click the code to select 1mysqldump-hhostname-uusername-ppassword databasename > backupfile.sql
2. Backup the MySQL database in the format with deleted tables
The backup MySQL database is in the format with deleted tables, which allows the backup to overwrite the existing database without manually deleting the existing database.
Double-click the code to select all 1mysqldump-- add-drop-table-uusername-ppassword databasename > backupfile.sql
3. Compress the backup of MySQL database directly
Double-click the code to select 1mysqldump-hhostname-uusername-ppassword databasename | gzip > backupfile.sql.gz
4. Back up some tables in MySQL database
Double-click the code to select 1mysqldump-hhostname-uusername-ppassword databasename specific_table1 specific_table2 > backupfile.sql
5. Backup multiple MySQL databases at the same time
Double-click the code to select 1mysqldump-hhostname-uusername-ppassword-databases databasename1 databasename2 databasename3 > multibackupfile.sql
6. Just back up the database structure
Double-click the code to select 1mysqldump-no-data-databases databasename1 databasename2 databasename3 > structurebackupfile.sql
7. Back up all databases on the server
Double-click the code to select 1mysqldump-all-databases > allbackupfile.sql
Second, restore command
1. The command to restore MySQL database
Double-click the code to select all 1mysql-hhostname-uusername-ppassword databasename < backupfile.sql
2. Restore compressed MySQL database
Double-click the code to select all 1gunzip < backupfile.sql.gz | mysql-uusername-ppassword databasename
3. Transfer the database to the new server
Double-click the code to select 1mysqldump-uusername-ppassword databasename | mysql-host=*.*-C databasename. The above is how to backup and restore in the Mysql database shared by the editor. If you happen to have similar doubts, please refer to the above analysis to understand. If you want to know more about it, you are welcome to follow the industry information channel.
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.