1.MySQL conflict from library data causes synchronization to stop
Show Slave Status Error
and show Slave status\g
Slave_IO_Running: YesSlave_SQL_Running: NOSeconds_Behind_Master: NULLLast_Error:Error ‘Can’t create database ‘linzhongniao’;database exists’on query.Default database:’linzhongniao’.Query:‘create database linzhongniao’
Workaround:
Method One:
Stop slaveSet global sql_slave_skip_counter=1Start slave
(1) for the ordinary Internet business, ignoring the problem is not very big, of course, to confirm that does not affect the company's business premise.
(2) The enterprise scenario solves the master-slave synchronization, which is more important to the current business than the master. If the master-slave data is consistent it is important to find a time to recover this from the library.
Method Two: Skip the specified error based on the error number
[[email protected] ~]# grep skip /data/3306/my.cnfskip-name-resolve 忽略名称解析解决mysql连接慢的问题。slave-skip-errors = 1032,1062 一般由于入库重复导致的失败就可以忽略。
Of course, you can also set the value of Slave-skip-errors to all, which causes the master-slave library data synchronization data to be missing. We can refer to the MySQL common error code to set the error number we want to ignore, and the error number to resolve the problem with MySQL.
MySQL Common error code:
1005: Failed to create table
1006: Failed to create database
1007: Database already exists, database creation failed <================= can be ignored
1008: Database does not exist, delete database failed <================= can be ignored
1009: Unable to delete database file causes database failure to be deleted
1010: Unable to delete data directory causes database failure to be deleted
1011: Failed to delete database file
1012: Cannot read records in system tables
1020: Record has been modified by another user
1021: Insufficient space on the hard drive, please increase the hard disk free space
1022: keyword Repeat, change record failed
1023: An error occurred while shutting down
1024: Read File error
1025: An error occurred while changing the name
1026: Write File Error
1032: Record does not exist <============================= can be ignored
1036: The data table is read-only and cannot be modified
1037: Insufficient system memory, please restart the database or restart the server
1038: Insufficient memory for sorting, increase the sort buffer
1040: The maximum number of connections to the database has been reached, please increase the number of available connections to the database
1041: Insufficient system memory
1042: Invalid host name
1043: Invalid connection
1044: The current user does not have permission to access the database
1045: Unable to connect to database, user name or password error
1048: field cannot be empty
1049: Database does not exist
1050: Data table already exists
1051: Data table does not exist
1054: field does not exist
1062: Duplicate field value, inbound failure <========================== can be ignored
1065: Invalid SQL statement, SQL statement is empty
1081: Unable to establish socket connection
1114: The data sheet is full and cannot hold any records
1116: Too many Open data tables
1129: Database is abnormal, please restart database
1130: Connection to database failed with no permissions to connect to database
1133: Database user does not exist
1141: The current user is not authorized to access the database
1142: The current user does not have permission to access the data table
1143: The current user does not have permission to access fields in the datasheet
1146: Data table does not exist
1147: User access to the data table is undefined
1149:sql statement Syntax error
1158: Network error, read error, please check network connection status
1159: Network error, read timeout, check network connection status
1160: Network error, write error, please check network connection status
1161: Network error, write timeout, please check network connectivity status
1169: Duplicate field value, update record failed
1177: Open Data table failed
1180: Commit TRANSACTION failed
1181: ROLLBACK TRANSACTION failure
1203: The current user and database establish a connection that has reached the maximum number of connections to the database, increase the number of available database connections or restart the database
1205: Lock timeout
1211: The current user does not have permission to create a user
1216: FOREIGN KEY constraint check failed, update child table record failed
1217: FOREIGN KEY constraint check failed, delete or modify master table record failed
1226: The current user is using more resources than allowed, please restart the database or restart the server
1227: Insufficient permissions, you do not have permission to do this
1235:mysql version is too low to have this feature
Mysql DBA Advanced Operations Learning Note-mysql Master-slave Replication troubleshooting