MysqlDatabase backup and restore common commands are the key to MySQL database backup and restore, there is no command,
WhatDo not have to do, not to mention what backup restore, only t
Tags: http io ar os sp on data div Art
Click on [Data Export] and the right side of the interface will show the Output window.
2Click the [Refresh] button, refresh the database list (1), select the data table (2) to export, set the exported directory (3), click the [Start Export] button to start exporting, wait for the export Progress interface progress to complete.END
Iv. Restoring the Database
By clicking [Data Import/restore], the D
Here are two methods for MySQL database backup/restore.
Method One:
Query ($sql); ///Make the generated temporary backup files together $outfile = Date ("y-m-d"). SQL "; if (File_exists ($dbdir. $outfile)) @unlink ($dbdir. $outfile); $FPR = fopen ($dbdir. $outfile, "a"); foreach ($txtname as $txt) {if (File_exists ($
Temusers and EMP Export]
Table for how to recover data
Access to the MySQL operator interface
Mysql>source full path to backup files
Scheduled backups: (write commands to My.bat)
How Windows timed Backups (2:00 per day)
Schedule a batch command with a scheduled task that is run with Windows.
Incremental backup
In the previous article we mentioned hot copies (the hot copy of MySQL backup and restore), and hot copies were backed up using the mysqlhotcopy command when MySQL or other database services were running. This article explains how to ensure data consistency. Now suppose there is a situation where we always back up the
: Used to specify the socket file, you can use-s instead;
Mysqlhotcopy is not a MySQL-band, it needs to install Perl's database interface package; for: http://dev.mysql.com/downloads/dbi.htmlCurrently, the tool is only able to back up tables of type MyISAM.Second, data restoration 1. The syntax for restoring a database backed up using the mysqldump command is as follows:Mysql-u root-p [dbname] Example:Mysql-u Root-p 2.
deleting tables A and Tstudent are recorded in bin-log.000003.Third, restore 1, the first to import fully prepared datamysql -h10.6.208.183 -utest2 -p123 -P3310 , or you can import it directly under the MySQL command line with source2, Restore bin-log.000002mysqlbinlog bin-log.000002 |mysql -h10.6.208.183 -utest2 -p12
access port, you can use-p instead;
--socket=socket file: Used to specify the socket file, you can use-s instead;
Mysqlhotcopy is not a MySQL-band, it needs to install Perl's database interface package; for: http://dev.mysql.com/downloads/dbi.htmlCurrently, the tool is only able to back up tables of type MyISAM.Second, data restoration 1. The syntax for restoring a database backed up using the mysqldump command is as follows:Mysql-u root-p
socket file, you can use-s instead;
Mysqlhotcopy is not a MySQL-band, it needs to install Perl's database interface package; for: http://dev.mysql.com/downloads/dbi.htmlCurrently, the tool is only able to back up tables of type MyISAM.Second, data restoration 1. The syntax for restoring a database backed up using the mysqldump command is as follows:mysql-u root-p [dbname] Example:Mysql-u Root-p 2. Restore
;
--socket=socket file: Used to specify the socket file, you can use-s instead;
Mysqlhotcopy is not a MySQL-band, it needs to install Perl's database interface package; for: http://dev.mysql.com/downloads/dbi.htmlCurrently, the tool is only able to back up tables of type MyISAM.Second, data restoration 1. The syntax for restoring a database backed up using the mysqldump command is as follows:Mysql-u root-p [dbname] Example:Mysql-u Root-p 2.
bin-log.000003.Third, recovery1, first import full datamysql-h10.6.208.183-utest2-p123-p3310 2, Restore bin-log.000002Mysqlbinlog bin-log.000002 |mysql-h10.6.208.183-utest2-p123-p33103, Recovery part bin-log.000003In the General_log, find the time point of the accidental deletion, and then the corresponding point in time to bin-log.000003 to find the corresponding position point, you need to revert to the
Tags: style blog class Code Java tarI believe many friends have experienced database problems, I also (see my previous blog: phpMyAdmin mistakenly deleted the recovery process after the table (the courage to jump AH)). If the data is large or important, it is very difficult to recover, so when we are doing a relatively perfect system, the backup/restore function of the database is essential. This article wi
MySQL database backup and restore of common command summary, learn MySQL friends can refer to the next.Commands to back up the MySQL databaseMysqldump-hhostname-uusername-ppassword databasename > Backupfile.sqlBacking up the MySQL
, which is certainly not the result we want. We need to back up the database into a single file, with the following commands:
Mysqldump-u mysqluser-p test_db > Test_db.sql
In this way, a file named Test_db.sql is backed up in the current directory.
Of course, if the size of the database is large, the backed-up files are usually compressed, and backup and compression can be done within the same line of command:
Cat Test_db.sql |
, if there are other scrolling binary files can be backed up separately]:#mysqlbinlog--start-post=107 mysql-bin.000003 mysql-bin.000004>/backup/incremental.sql8. Restore Data:#cp-a/bakcup/*/mysql/data/#service mysqld StartMysql> set sql_log_bin=0;
Original: MySQL Backup and restoreMySQL backup and restore is done using the mysqldump, MySQL, and source commands.backup and restore of MySQL under 1.win321.1 BackupStart Menu | Run |
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);echo "Success";******************************
mysqlmysql service is stopping: The MySQL service has stopped successfully. C:\Program files\mysql\bin>net start mysqlmysql service is starting. The MySQL service has started successfully. 11. Forget password processingFor example, open the configuration file My.ini add skip-grant-tablesbelow mysqld, save the exit and restart the
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
The following is a test in a 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);
echo "Success";
*************************
databasename1 databasename2 databasename3 > Structurebackupfile.sql
Back up all databases on the server
Mysqldump--all-databases Allbackupfile.sql
command to restore MySQL database
Mysql-hhostname-uusername-ppassword DatabaseName
Restoring a compressed M
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.