Run the mysql backup and recovery command bitsCN.com under Win to store the backup database under the d: disk root directory. the backup database name is backup20070713. SQL (20070713. SQL indicates the backup date)
Back up the database:
Mysqldump-uroot-p123456 databas
Label:1. Create and edit the file/usr/sbin/bakmysql, command: Vi/usr/sbin/bakmysql The contents are as follows: 1 db_ user= "root" 2 db_passwd= "root" Span style= "color: #008080;" >3 db_name= "Db_test" 4 # the directory for stories your backup file.you shall change this dir 5 backup_dir= "/usr/software/backup/mysqlbackup" 6 # date format for
MySQL database using command-line Backup | MySQL Database backup commandFor example:Database address: 127.0.0.1Database user name: rootDatabase Password: PassDatabase name: MyWebBack up the database to the D disk and directory Mysqldump-h127.0.0.1-uroot-ppass myweb > D:/backupfile.sqlBack up to current directory The MySQL database is formatted with the Delete tab
File compression and decompressionTar commandThe TAR command creates archives for Linux files and directories.With tar, you can create files (backup files) for a specific file, or you can change files in the file or add new files to the file. Tar was originally used to create archives on tape, and now users can create files on any device.With the tar command, you
Restore a database: mysql-h localhost-u root-p123456 wwwBacking up a database: mysqldump-h localhost-u root-p123456 www > d:\www2008-2-26.sqlWhere www is the database nameThe following is a test in the program$command = "Mysqldump–opt-h $dbhost-u $dbuser-P $dbpass $dbname | gzip > $backupFile ";$command = "Mysqldump-h localhost-u root-p123456 guestbook > Guestbook2-29.sql";System ($
The Redis SAVE command is used to create a backup of the current database. GrammarThe basic syntax for the Redis Save command is as follows: Redis 127.0.0.1:6379> SAVE InstanceRedis 127.0.0.1:6379> SAVE OK This command will create the Dump.rdb file in the Redis installation directory. Recovering dataIf you need to reco
Restore a database: mysql-h localhost-u root-p123456 WwwBacking up a database: mysqldump-h localhost-u root-p123456 www > d:/www2008-2-26.sqlThe following is a test in the program$command = "Mysqldump--opt-h $dbhost-u $dbuser-P $dbpass $dbname | gzip > $backupFile ";$command = "Mysqldump-h localhost-u root-p123456 guestbook > Guestbook2-29.sql";System ($command);
one. mysql backup command:1. Backing up a single databasemysql> system mysqldump-uroot-pmybaby99 WordPress >/tmp/wordpress.sql;mysql> system Ls-l/tmp/wordpress.sql;-rw-r--r--1 root root 292760 Oct 18:43/tmp/wordpress.sql2. Compress the backup:[Email protected] mysql]# mysqldump-uroot-pmybaby99 wordpress|gzip >/server/bak/wordpress.sql.gz;[Email protected] mysql]#
How can I run the mysql backup and recovery command in Win? assume that mysql is installed on a c: disk, the mysql database username is root, the password is 123456, the database name is database_name, and in d: the backup database is stored under the root directory. the backup database name is backup20070713. SQL (200
Restore A Database: mysql-H localhost-u root-p123456 WWW
Back up a database: mysqldump-H localhost-u root-p123456 WWW> D:/www2008-2-26. SQL(Note: If you are running the mysqldump command on Windows, you need to go to the bin directory of the MySQL installation directory for execution. Otherwise, the system will prompt that the command cannot be found)
// The following areProgramTesting
// $
In Windows, I used the Navicat for mysql tool at the beginning to use the export/import database function in MySQL. However, some tables were lost after the export; so I thought of the command line.
The following is a command line backup and restoration method:
Set MySQL to disk c. the mysql database username is root, the password is 123, and the database
up all databases, delete all previous incremental logs and generate new logs:Mysqldump-h192.168.4.20-uusername-puserpswd -- single-transaction -- flush-logs -- master-data = 2 -- all-databases -- delete-master-logs> data_bck. SQLIncremental Backup:Perform a full backup and then update the log:Mysqladmin-h192.168.4.20-uusername-puserpswd flush-logs
3. copy the data directory directly.Stop the mysql service or lock the database table, copy the data dir
VPS Scheduled BACKUP DATABASE command, save the following code as BACKSQL.SH, and then set the scheduled task to run.cd/home/admin/Backup #切换到备份目录btimes=$(Date+%y%m%d%h%M) #定义备份时间agobtimes=$(Date-d-7day +%y%m%d%h%M) #定义删除七天前的备份RM-RF Allsql/vps_all_db_$agobtimes.Tar. GZ #删除操作 forDbinch'/usr/bin/mysql--user="Root"--password="123456"-b-n-E'SHOW DATABASES'|Xargs` Do(
This article collects a large number of statements and examples about the mysqldump command. It also describes usage instructions on foreign websites. For more information, see.
This article collects a large number of statements and examples about the mysqldump command. It also describes usage instructions on foreign websites. For more information, see.
The Code is as follows:
D
In Linux, the commonly used file compression tools are gzip, bzip2, zip. BZIP2 is the ideal compression tool that provides maximum compression. Zip compatibility good windows also supports1.BZIP2 commandAt the shell prompt, enter the command: Zip file:bzip2 filename //file will be compressed and saved as filename.bz2 extract file:bunzip2 filename.bz2 //filename.bz2 will be deleted, and filename instead of bzip2 filename.bz2 file1 file2 file3/
cpio Command[[email protected] ~]# CPIO-COVB > [file|device] [[email protected] ~]# Cpio-icduv Parameters-o: Data copy output to a file or device-I: Copy data from file or device to system-T: View the contents of a file or device created by Cpio-C: A newer portable format mode storage-V: Allows the file name to be displayed on the screen during storage-B: Let the preset Blocks be added to 5120 bytes, the preset is bytes!The benefit is that large files
Mysql database backup transfer command backup MySQL database command mysqldump-hhostname-uusername-ppassword databasename> backupfile. the SQL backup MySQL database is in the format of a table with deletion. the MySQL database is in the format of a table with deletion. This
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.