[Linux] The slave I/O thread reports an error

1. Error reporting

I/O thread error

Check the /var/log/mysqld.d log to check the error report;

 On the slave machine, port 3306 of the telnet host shows that the connection is refused;


And the slave mysql login user password problem, the password input is correct but an error is reported [ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: YES)];


mine

2. Troubleshooting ideas

  1. Is the ip configuration correct?
  2. Whether the configuration master and slave files are correct
  3. Whether the firewall is closed;
  4. Is the iptables rule cleared?
  5. Is selinux forbidden
  6. Whether the slave can ping the master
  7. Whether port 3306 of the telnet host can be connected
  8. If mysql is password-free authentication, there is no port 3306 on the slave telnet host, and the password-free authentication must be turned off
  9. Whether the slave is started

The solution steps are as follows:

1. Edit the /etc/my.cnt file, add a piece of code under [mysqld]; save and exit

skip-grant-tables

2. Restart mysql

systemctl restart mysqld

3. Enter mysql; (no password is required at this time)

mysql -uroot

4. View root user password:

select user,host,plugin,authentication_string from mysql.user;

 You can view the user password is very messy, it is wrong

5. Modify root user password;

update mysql.user set  authentication_string='*16F51094B9A153AECE86BCA3F7A237CB6FE5C183' where user='root';

Because my copy user has the same password as the root user, I changed it to the copy user's password

6. After the modification is completed, exit mysql, edit /etc/my.cnf, and comment the code added in the first step;

7. Log in to mysql again and enter the password to log in normally;

8. In show slave status\G; just fine

Guess you like

Origin blog.csdn.net/weixin_65690979/article/details/130161092