Text: often use the contact MySQL copy function of friends should be not unfamiliar with the mysqldump command, I recently also in the study of this piece of content, after a few days of testing, found that mysqldump use easy to meet a few problems, here to summarize and share with you, If there are different views welcome to Exchange study,
Software version, website download 5.5.53
Application scenario, mysqldump the primary MySQL server to get SQL statements and then restore to a blank MySQL server
Summary 1: If the master server is backed up with a non-root user with a password before restoring to the backup MySQL server, you must run the flush privileges command on the backup server or you can log on without a password. If you do not execute this command, when you make a backup of the MySQL server, the authentication fails for the rep user, and the IO process cannot connect to the master error.
Summary 2: For--master-data This parameter in mysqldump, if this parameter is used in the backup, when you restore the SQL statement to the slave MySQL server, you must first execute the change msater to of the four commands, that is, first specify the host PORT USER PASSWORD then restore the SQL statement, otherwise--master-data This command does not produce the actual use, slave will start from the default 107 location, resulting in errors, the SQL process is stopped, and you need to manually specify Binlog files and logs, so that the start Slave can see that the system automatically reads the correct binlog location and file. So you first specify the master four parameters, then restore the SQL statement, and then turn on slave.
This article is from the "loss is Blessing" blog, please be sure to keep this source http://dragonfly.blog.51cto.com/2928582/1872737
Mysqldump some experience in the use of BACKUP commands