Home IT Linux Windows Database Network Programming Server Mobile  
           
  Home \ Database \ mysqldump implement database logical backup     - Set up MySQL master and slave servers under Ubuntu 14.04 (Server)

- Make command tutorial (Linux)

- Bash code injection attacks through a special environment variable (Linux)

- Analysis of native Java keywords (Programming)

- NGINX Plus now fully supports HTTP / 2 (Server)

- Fast Learning Clojure (Programming)

- Appweb configuration in detail (Server)

- Use rfkill soft-switching and Bluetooth wireless capabilities in Linux (Linux)

- STL spatial Configurator (Programming)

- Single-node Hadoop environment to build (Server)

- Linux Getting Started Tutorial: Ubuntu laptop screen brightness adjustment (Linux)

- JavaScript event handling Detailed (Programming)

- CentOS6.7 text installation system (Linux)

- Use FirewallD build dynamic firewall (Linux)

- Install Ubuntu open source drawing program MyPaint 1.2.0 (Linux)

- Protection Docker container Notice (Server)

- MultiWriter: while the ISO image concurrent writes 20 USB Startup Disk (Linux)

- CentOS 6.5_x64 install Oracle 11g R2 (Database)

- Linux command binlog by filtering out the complete SQL statement (Database)

- Oracle 10046 Event (Database)

 
         
  mysqldump implement database logical backup
     
  Add Date : 2018-11-21      
         
       
         
  Mysqldump is mysql tools used for logical backup. In the process of database backup, you need to include a backup, the database itself, data, binary files (used for database even point reduction).

Following is a brief introduction to the next.

Backup starts:

1: landing mysql process, will need to enter a password, enter the password each time if you want to avoid tedious, you can create .my.cnf hidden files in the login user's home directory to root user as an example

vi /root/.my.cnf

[Client]

user = 'root'

password = 'exit'

host = 'localhost'

Again until landing time, landing mysql can directly enter the system.

2: Back up the database

mysql database connection

show master status; // that is used to view the current binary log file.

mysqldump -all-databases -lock-all-tables -flush-logs-master-data = 2> / root`date +% F-% H-% M-% S`.sql

Now the database backup, backup binary log file below, after the backup or data binary log files have been refreshed, says a new binary log file is generated, the file name is the serial number on a binary file plus one.

Binary log files will be backed up before the first flush

mysqlbinlog /data/mydata/mysql-bin.000005> /root/1.sql

mysql database connections increment

use stu;

insert into score (name, score) values ( 'xiaozhang', 96);

select * from score;

quit

One day after the last incremental backup

mysqlbinlog /data/mydata/mysql-bin.000006>/root/2.sql

3: Analog database damage.

cd / data / mydata

rm -rf *

killall mysqld // forced to close off all the processes mysql.

Re-initialize the database

cd / usr / local / mysql

scripts / mysql_install-db --user = mysql -datadir = / data / mydata

Before it restores the database to connect to mysql, the binary log file function off.

mysql

set sql_log_bin = 0 // Binary logging does not need to open the database restore process.

quit

mysql < / root / `date +% F-% H-% M-% S`.sql // just backed up the database.

mysql < /root/1.sql // import binary log files

mysql < /root/2.sql // import binary incremental backup files

The reduction is complete, the connection open mysql binary log function.

mysql

set sql_log_bin = 1

purge binary logs to 'mysql-bin.000006'; // delete No binary log file.

Well, mysqldump logic also previously said that. After continued.
     
         
       
         
  More:      
 
- Android memory optimization of the optimal load Bitmap (Linux)
- Linux installed and tested the deployment of Kafka distributed cluster (Server)
- ORA-04031 error appears in the solution 11.2.0.4 run utlrp.sql (Database)
- Linux --- file descriptors and redirection (Linux)
- installation of Piwik under Ubuntu (Programming)
- Linux system versions organize local root password cracking method (Linux)
- Java implementation chain store binary search tree (recursive method) (Programming)
- MySQL bulk insert data script (Database)
- Ubuntu 14.04 + xRDP + Xfce implement Windows Remote Desktop Connection (Linux)
- How SSHfs mount a remote file system on Linux (Linux)
- Java Set and List in the relationship and difference (Programming)
- Oracle inline view updates problems encountered (Database)
- Use JMS listener Oracle AQ, trigger the execution of Java programs in the database changes (Database)
- GDB remote connections RX Probe online debug program (Programming)
- Ubuntu install Oracle 10g process and problem solution (Linux)
- PostgreSQL export data dictionary documents (Database)
- Linux package manager - yum (Linux)
- To install GCC development environment under SUSE11 (Linux)
- Java look and feel mode (Facade mode) (Programming)
- Why do you need close contact Rust 1.0 (Programming)
     
           
     
  CopyRight 2002-2016 newfreesoft.com, All Rights Reserved.