MySQL master-slave synchronization Common Error solving method

Source: Internet
Author: User

There are two threads in the database master-slave synchronization: IO thread and SQL thread. Common error occurs around these two threads.

IO Thread: Logs the contents of the main library Binlog log to the local relay log file. The
IO thread error has two reasons, first, the parameter information is wrong when the main library information is specified, and the second time security limit (including Firewall,selinux).

View the cause of the error:
mysql> show slave status\g
...
last_io_error: Error message
...
Common error prompt: Error connecting to master ' [email protected]:3306 '-retry-time:60 retries:1
strong> Error Notification error when specifying the main library information parameter from the database server, usually a

that is inconsistent with the user or password when the primary library is authorized. Additionally, if the parameter is incorrect when specifying the main library information, You can view the file Master.info
[[email protected]]# Cat/var/lib/mysql/master.info] that records the connection master library information under the database directory.

> The parameter here is the parameter set when specifying the main library information
commands and examples when specifying the main library information
mysql> change master to
, Master_ host= "IP Address",
, master_user= "user name specified at time of authorization",
, master_password= "User password",
-master_log_file= " Binlog log ",
-master_log_pos= offset;

repair IO thread:
mysql> stop slave;
mysql> change Master to option = value;
mysql> start slave;

SQL thread: Executes the SQL command in the native relay log file, writes the data into the native database
SQL thread error Cause: The library or table used by SQL commands in the trunk log file does not exist natively
Fix SQL Thread:
View the libraries and tables in the native and primary database servers so that the machine has a library or table in the primary database server.
Stop the slave service before starting the slave service after the Night Library or table
mysql> stop Slave;
Modify
mysql> start slave;

MySQL master-slave synchronization Common Error solving method

Contact Us

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.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.