When configuring MySQL master and slave, check the slave status, find the error message,
The Error ' The MySQL server is running with the--skip-grant-tables option so it cannot execute this statement ' on query.
mysql> show slave status\g*************************** 1. row **************** slave_io_ state: waiting for master to send event master_host: 192.168.100.100 master_user: repl Master_Port: 3306 Connect_Retry: 60 Master_Log_File: BP.000001 read_master_log_pOs: 1047 relay_ log_file: bp2-relay-bin.000002 relay_log_pos: 276 relay_master_ Log_file: bp.000001 slave_io _running: yes slave_sql_running: no replicate_do_db: Replicate_Ignore_DB: replicate_do_table: replicate_ Ignore_table: replicate_wild_do_table: replicate_wild_ignore_ Table: &nBsp; last_errno: 1290 Last_Error: Error ' the mysql server is running with The --skip-grant-tables option so it cannot execute this statement ' on query. Default database: ' . query: ' Grant replication slave ON *.* TO ' repl ' @ ' 192.168.100.101 ' IDENTIFIED BY PASSWORD ' * 137bc20d2dd742d4394762a7f009ae373961df0d ' Skip_Counter: 0 Exec_Master_Log_Pos: 120 relay_log_space: 1374 until_condition: None until_log_file: until_log_pos: 0 Master_SSL_Allowed: No Master_SSL_CA_File: Master_SSL_CA_Path: Master_SSL_Cert: Master_SSL_Cipher: Master_SSL_Key: Seconds_Behind_Master: Nullmaster_ssl_verify_server_cert: no last_ io_errno: 0 Last_IO_Error: last_sql_errno: 1290 Last_SQL_Error: Error ' the mysql server is running with the --skip-grant-tables option so it cannot execute this statement ' on query. default database: ' . query: ' grant replication slave on *.* to ' repl ' @ ' 192.168.100.101 ' IDENTIFIED BY PASSWORD ' * 137bc20d2dd742d4394762a7f009ae373961df0d ' Replicate_Ignore_Server_Ids: master_server_id: 100 Master_UUID: 274d9644-7398-11e8-8f4c-000c29a272ec master_info_file: /data/mysql/ master.info sql_delay: 0 sql_ remaining_delay: null slave_sql_running_state: Master_Retry_Count: 86400 Master_Bind: Last_IO_Error_Timestamp: Last_SQL_Error_Timestamp: 180725 10:41:22 Master_SSL_Crl: Master_SSL_Crlpath: Retrieved_Gtid_Set: executed_gtid_set: Auto_Position: 01 row in set (0.00 SEC)
Analysis:
MySQL authentication failed--The password is not---excluded because the my.cnf configured skip-grant bypass password Authentication configuration parameters
--profile--and whether the Skip-grant parameter affects the communication between the master and the slave--removing the #skip-grant parameter and resolving it
Workaround:
Delete the skip-grant parameter of the MySQL config file my.cnf, or comment out.
[Mysqld]datadir=/data/mysqlsocket=/tmp/mysql.sockserver-id=101#skip-grant
MySQL Master-slave configuration failed, master-slave communication failed