Learn a few days of MySQL knowledge. Just get in touch with a command that is simply a grammar. But when there is a problem, I don't know where to begin. It is still not practical to find the relevant information on the Internet. So I began to summarize the backup and restore examples. This article is used by mysqldump. 2 case operations were performed. Of course two cases are very similar. The second one expands for the first one. If you figure out the principles of these 2 examples. The next step is to perform an LVM backup restore and Xtrabackup This backup tool will be much easier.
How MySQL is backed up
Prerequisite: In advance to ensure that the backup type, backup strategy, such as MySQL common knowledge is clear.
Mysqldump: Logical Backup tool
Example one, we created a small educational management system, only in MySQL, there is a Jiaowu table, we have a backup of this database + incremental backup + restore
Mysqldump (full backup) + binary log
Preparation: Open 2 Linux connection windows in Xshell (mainly for lock table operations), we assign them to numbers for easy instructions, and if there is no Xshell tool, you can use screen in Linux. Specific use can search screen, we mainly talk about backup.
First of all, in 1 to the MySQL lock table operation
[root@localhost ~]# mysql
mysql> FLUSH TABLES with READ LOCK; # #以只读的方式进行锁表
mysql> FLUSH; # #滚动日志
mysql> show BINARY LOGS; # #查看