当前位置:网站首页>Mysql database backup command -- mysqldump
Mysql database backup command -- mysqldump
2022-04-23 18:14:00 【The hunter is eating meat】
List of articles
mysqldump explain
Default mysqldump Derived SQL In file , It not only contains the exported data , It also includes the export of all data tables in the database structural information .
in addition , Use mysqldump Derived SQL If the file does not have an absolute path , The default is to save in bin In the catalog .
1、mysql Configuration information
Database address :127.0.0.1
Database user name :root
Database password :pass
Database name :myweb
2、 Backup
Back up the database to D Disk and directory
mysqldump -h127.0.0.1 -uroot -ppass myweb > d:/backupfile.sql
Back up to the current directory Backup MySQL The database is in the form of deleted tables , The backup can overwrite the existing database without manually deleting the original database
mysqldump --add-drop-table -h127.0.0.1 -uroot -ppass myweb > backupfile.sql
Direct will MySQL Database compression backup Backup to D Disk and directory
mysqldump -h127.0.0.1 -uroot -ppass myweb | gzip > d:/backupfile.sql.gz
Backup MySQL A database ( some ) surface . This example backup table1 Table and table2 surface . Backup to linux The host /home Next
mysqldump -h127.0.0.1 -uroot -ppass myweb table1 table2 > /home/backupfile.sql
Backup multiple files at the same time MySQL database
mysqldump -h127.0.0.1 -uroot -ppass --databases myweb myweb2 > multibackupfile.sql
Just back up the database structure . At the same time, the backup name is myweb Database and name myweb2 database
mysqldump --no-data -h127.0.0.1 -uroot -ppass --databases myweb myweb2 > structurebackupfile.sql
Back up all databases on the server
mysqldump --all-databases -h127.0.0.1 -uroot -ppass > allbackupfile.sql
3、 Restore
Restore MySQL Database commands . Restore the current backup named backupfile.sql The database of
mysql -h127.0.0.1 -uroot -ppass myweb < backupfile.sql
Log in to mysql database
then , Carry out by source Command execution recovery
source /backup/backupfile.sql
Restore compressed MySQL database
gunzip < backupfile.sql.gz | mysql -h127.0.0.1 -uroot -ppass myweb
Move the database to the new server .
This example is to the local database myweb Copy to the remote database named serweb in ,
among , The remote database must be named serweb The database of , It should be created in advance
mysqldump -h127.0.0.1 -uroot -ppass myweb | mysql --host=***.***.***.*** -u Database user name -p Database password -C serweb
版权声明
本文为[The hunter is eating meat]所创,转载请带上原文链接,感谢
https://yzsam.com/2022/04/202204210611118300.html
边栏推荐
- Nat commun | current progress and open challenges of applied deep learning in Bioscience
- Docker 安装 Redis
- Identification verification code
- Feign requests the log to be printed uniformly
- 硬核解析Promise對象(這七個必會的常用API和七個關鍵問題你都了解嗎?)
- Using transmittablethreadlocal to realize parameter cross thread transmission
- Stanford machine learning course summary
- Dock installation redis
- Implement a simple function to calculate the sum of all integers between M ~ n (m < n)
- 【ACM】70. climb stairs
猜你喜欢

Install the yapiupload plug-in in idea and upload the API interface to the Yapi document

硬核解析Promise對象(這七個必會的常用API和七個關鍵問題你都了解嗎?)
![[UDS unified diagnostic service] v. diagnostic application example: Flash bootloader](/img/45/f9e24ae1c619f78aeeb7bcf12d6e5f.png)
[UDS unified diagnostic service] v. diagnostic application example: Flash bootloader

Map basemap Library

Dock installation redis

How to install jsonpath package

Closure type of rust (difference between FN, fnmut and fnone)

由tcl脚本生成板子对应的vivado工程

From introduction to mastery of MATLAB (2)

Dynamically add default fusing rules to feign client based on sentinel + Nacos
随机推荐
GDAL + ogr learning
Deep learning classic network analysis and target detection (I): r-cnn
Nodejs安装
Yolov4 pruning [with code]
C byte array (byte []) and string are converted to each other
Calculation of fishing net road density
Implement a simple function to calculate the sum of all integers between M ~ n (m < n)
【ACM】455. Distribute Biscuits (1. Give priority to big biscuits to big appetite; 2. Traverse two arrays with only one for loop (use subscript index -- to traverse another array))
Dock installation redis
ArcGIS table to excel exceeds the upper limit, conversion failed
ArcGIS license error -15 solution
Secure credit
How to ensure the security of futures accounts online?
Robocode Tutorial 4 - robocode's game physics
Flash operates on multiple databases
Installation du docker redis
Scikit learn sklearn 0.18 official document Chinese version
C language input and output (printf and scanf functions, putchar and getchar functions)
Romance in C language
C language loop structure program