1、grant replication slave, reload, super on *.* to 'slave'@'172.16.%' identified by '123456';但是用slave 在住服务器上登录,却看不到要同步的数据;
2、Slave_IO_Running: No可能跟第一点有关系吧;3、show processlist\G之前有三个进程,其中一个sleep,现在变成两个了,只有Query 和 Connect(Has read all relay log; waiting for the slave I/O thread to update it)
2、Slave_IO_Running: No可能跟第一点有关系吧;3、show processlist\G之前有三个进程,其中一个sleep,现在变成两个了,只有Query 和 Connect(Has read all relay log; waiting for the slave I/O thread to update it)
log_bin = /var/log/mysql/mysql-bin.log
expire_logs_days = 10
max_binlog_size = 100M
binlog_do_db = oppo_product_bbs15
binlog_ignore_db = test## sjh End
从服务器my.conf
## sjh Beginserver-id = 2
master-host = 172.16.106.190 #master IP
master-user = slave
master-password = 123456## sjh Endchange master to
master_host='172.16.106.190',
master_user=’slave’,
master_password='123456',
master_log_file='mysql-bin.000002',
master_log_pos=98,
master_port=3306,
master_connect_retry=60;
start slave
看看你得错误日志
另外第一点修正一下:1、grant replication slave, reload, super on *.* to 'slave'@'172.16.%' identified by '123456';但是用slave 在住服务器上登录,却看不到要同步的数据库;
110322 10:24:58 [Warning] option 'max_join_size': unsigned value 18446744073709551615 adjusted to 4294967295
110322 10:24:58 [Warning] option 'max_join_size': unsigned value 18446744073709551615 adjusted to 4294967295
InnoDB: The first specified data file ./ibdata1 did not exist:
InnoDB: a new database to be created!
110322 10:24:58 InnoDB: Setting file ./ibdata1 size to 10 MB
InnoDB: Database physically writes the file full: wait...
110322 10:24:58 InnoDB: Log file ./ib_logfile0 did not exist: new to be created
InnoDB: Setting log file ./ib_logfile0 size to 5 MB
InnoDB: Database physically writes the file full: wait...
110322 10:24:59 InnoDB: Log file ./ib_logfile1 did not exist: new to be created
InnoDB: Setting log file ./ib_logfile1 size to 5 MB
InnoDB: Database physically writes the file full: wait...
InnoDB: Doublewrite buffer not found: creating new
InnoDB: Doublewrite buffer created
InnoDB: Creating foreign key constraint system tables
InnoDB: Foreign key constraint system tables created
110322 10:24:59 InnoDB: Started; log sequence number 0 0
110322 10:24:59 [ERROR] Can't start server: Bind on TCP/IP port: Address already in use
110322 10:24:59 [ERROR] Do you already have another mysqld server running on port: 3306 ?
110322 10:24:59 [ERROR] Aborting110322 10:24:59 InnoDB: Starting shutdown...
110322 10:25:00 InnoDB: Shutdown completed; log sequence number 0 43655
110322 10:25:00 [Note] /usr/local/mysql/libexec/mysqld: Shutdown complete110322 10:25:00 mysqld ended110322 10:25:14 mysqld started
110322 10:25:14 [Warning] option 'max_join_size': unsigned value 18446744073709551615 adjusted to 4294967295
110322 10:25:14 [Warning] option 'max_join_size': unsigned value 18446744073709551615 adjusted to 4294967295
110322 10:25:14 InnoDB: Started; log sequence number 0 43655
110322 10:25:14 [ERROR] Can't start server: Bind on TCP/IP port: Address already in use
110322 10:25:14 [ERROR] Do you already have another mysqld server running on port: 3306 ?
110322 10:25:14 [ERROR] Aborting110322 10:25:14 InnoDB: Starting shutdown...
110322 10:25:16 InnoDB: Shutdown completed; log sequence number 0 43655
"centos188.localdomain.err" 311L, 33363C
110419 17:07:49 [Note] Slave SQL thread initialized, starting replication in log 'FIRST' at position 0, relay log './centos188-relay-bin.000001' position: 4
110419 17:07:49 [Note] Slave I/O thread: connected to master '[email protected]:3306', replication started in log 'FIRST' at position 4
110419 17:07:49 [ERROR] The slave I/O thread stops because master and slave have equal MySQL server ids; these ids must be different for replication to work (or the --replicate-same-server-id option must be used on slave but this does not a
lways make sense; please check the manual before using it).110419 17:07:49 [Note] Slave I/O thread exiting, read up to log 'FIRST', positio
n 4110419 17:21:50 [Note] Error reading relay log event: slave SQL thread was kille
d
110419 17:35:02 [Note] Slave SQL thread initialized, starting replication in log 'mysql-bin.000002' at position 85159, relay log './centos188-relay-bin.000001' position: 4
110419 17:35:02 [Note] Slave I/O thread: connected to master '[email protected]:3306', replication started in log 'mysql-bin.000002' at position 85159
110419 17:35:02 [ERROR] The slave I/O thread stops because master and slave have equal MySQL server ids; these ids must be different for replication to work (or the --replicate-same-server-id option must be used on slave but this does not a
lways make sense; please check the manual before using it).
110419 17:35:02 [Note] Slave I/O thread exiting, read up to log 'mysql-bin.00000
2', position 85159
110419 18:56:51 [Note] /usr/local/mysql/libexec/mysqld: Normal shutdown110419 18:56:51 [Note] Error reading relay log event: slave SQL thread was kille
d
110419 18:56:51 InnoDB: Starting shutdown...110419 18:56:52 InnoDB: Shutdown completed; log sequence number 0 43655
110419 18:56:52 [Note] /usr/local/mysql/libexec/mysqld: Shutdown complete110419 18:56:52 mysqld ended110419 18:56:53 mysqld started110419 18:56:53 [Warning] option 'max_join_size': unsigned value 18446744073709551615 adjusted to 4294967295
110419 18:56:53 [Warning] option 'max_join_size': unsigned value 184467440737095
51615 adjusted to 4294967295110419 18:56:53 [Warning] The syntax for replication startup options is deprecat
ed and will be removed in MySQL 5.2. Please use 'CHANGE MASTER' instead.
110419 18:56:53 InnoDB: Started; log sequence number 0 43655
110419 18:56:53 [Warning] Neither --relay-log nor --relay-log-index were used; so replication may break when this MySQL server acts as a slave and has his hostname changed!! Please use '--relay-log=centos188-relay-bin' to avoid this problem.
110419 18:56:53 [Note] /usr/local/mysql/libexec/mysqld: ready for connections.Version: '5.0.77-log' socket: '/tmp/mysql.sock' port: 3306 Source distribution110419 18:56:53 [Note] Slave SQL thread initialized, starting replication in log 'mysql-bin.000002' at position 85159, relay log './centos188-relay-bin.000001' position: 98110419 18:56:53 [Note] Slave I/O thread: connected to master '[email protected]:3306', replication started in log 'mysql-bin.000002' at position 85159110419 18:56:53 [ERROR] The slave I/O thread stops because master and slave have equal MySQL server ids; these ids must be different for replication to work (or the --replicate-same-server-id option must be used on slave but this does not always make sense; please check the manual before using it).110419 18:56:53 [Note] Slave I/O thread exiting, read up to log 'mysql-bin.000002', position 85159110419 19:02:19 [Note] /usr/local/mysql/libexec/mysqld: Normal shutdown
110419 19:02:19 [Note] Error reading relay log event: slave SQL thread was killed110419 19:02:19 InnoDB: Starting shutdown...110419 19:02:19 InnoDB: Shutdown completed; log sequence number 0 43655110419 19:02:19
110419 19:02:19 mysqld ended
110419 19:02:20 mysqld started110419 19:02:20 [Warning] option 'max_join_size': unsigned value 18446744073709551615 adjusted to 4294967295110419 19:02:20 [Warning] option 'max_join_size': unsigned value 18446744073709551615 adjusted to 4294967295110419 19:02:20 [Warning] The syntax for replication startup options is deprecated and will be removed in MySQL 5.2. Please use 'CHANGE MASTER' instead.110419 19:02:20 InnoDB: Started; log sequence number 0 43655110419 19:02:20 [Warning] Neither --relay-log nor --relay-log-index were used; so replication may break when this MySQL server acts as a slave and has his hostname changed!! Please use '--relay-log=centos188-relay-bin' to avoid this problem.110419 19:02:20 [Note] /usr/local/mysql/libexec/mysqld: ready for connections.Version: '5.0.77-log' socket: '/tmp/mysql.sock' port: 3306 Source distribution110419 19:02:20 [Note] Slave SQL thread initialized, starting replication in log 'mysql-bin.000002' at position 85159, relay log './centos188-relay-bin.000002' position: 98110419 19:02:20 [Note] Slave I/O thread: connected to master '[email protected]:3306', replication started in log 'mysql-bin.000002' at position 85159110419 19:02:20 [ERROR] The slave I/O thread stops because master and slave have equal MySQL server ids; these ids must be different for replication to work (or the --replicate-same-server-id option must be used on slave but this does not always make sense; please check the manual before using it).110419 19:02:20 [Note] Slave I/O thread exiting, read up to log 'mysql-bin.000002', position 85159110419 19:07:04 [Note] Slave I/O thread: connected to master '[email protected]:3306', replication started in log 'mysql-bin.000002' at position 85159110419 19:07:04 [ERROR] The slave I/O thread stops because master and slave have equal MySQL server ids; these ids must be different for replication to work (or the --replicate-same-server-id option must be used on slave but this does not always make sense; please check the manual before using it).110419 19:07:04 [Note] Slave I/O thread exiting, read up to log 'mysql-bin.000002', position 85159110419 19:22:56 [Note] Error reading relay log event: slave SQL thread was killed110419 19:23:23 [Note] Slave SQL thread initialized, starting replication in log 'mysql-bin.000002' at position 85159, relay log './centos188-relay-bin.000001' position: 4110419 19:23:23 [Note] Slave I/O thread: connected to master '[email protected]:3306', replication started in log 'mysql-bin.000002' at position 85159110419 19:23:23 [ERROR] The slave I/O thread stops because master and slave have equal MySQL server ids; these ids must be different for replication to work (or the --replicate-same-server-id option must be used on slave but this does not always make sense; please check the manual before using it).110419 19:23:23 [Note] Slave I/O thread exiting, read up to log 'mysql-bin.000002', position 85159110419 19:32:11 [Note] Error reading relay log event: slave SQL thread was killed110419 19:32:15 [Note] Slave SQL thread initialized, starting replication in log 'mysql-bin.000002' at position 85159, relay log './centos188-relay-bin.000001' position: 98110419 19:32:16 [Note] Slave I/O thread: connected to master '[email protected]:3306', replication started in log 'mysql-bin.000002' at position 85159110419 19:32:16 [ERROR] The slave I/O thread stops because master and slave have equal MySQL server ids; these ids must be different for replication to work (or the --replicate-same-server-id option must be used on slave but this does not always make sense; please check the manual before using it).110419 19:32:16 [Note] Slave I/O thread exiting, read up to log 'mysql-bin.000002', position 85159110419 19:50:58 [Note] Error reading relay log event: slave SQL thread was killed110419 19:51:02 [Note] Slave SQL thread initialized, starting replication in log 'mysql-bin.000002' at position 85159, relay log './centos188-relay-bin.000001' position: 98110419 19:51:02 [Note] Slave I/O thread: connected to master '[email protected]:3306', replication started in log 'mysql-bin.000002' at position 85159110419 19:51:02 [ERROR] The slave I/O thread stops because master and slave have equal MySQL server ids; these ids must be different for replication to work (or the --replicate-same-server-id option must be used on slave but this does not always make sense; please check the manual before using it).110419 19:51:02 [Note] Slave I/O thread exiting, read up to log 'mysql-bin.000002', position 85159110419 20:10:05 [Note] /usr/local/mysql/libexec/mysqld: Normal shutdown
110419 20:10:05 [Note] Error reading relay log event: slave SQL thread was killed110419 20:10:05 InnoDB: Starting shutdown...110419 20:10:06 InnoDB: Shutdown completed; log sequence number 0 43655110419 20:10:06 [Note] /usr/local/mysql/libexec/mysqld: Shutdown complete
110419 20:10:06 mysqld ended
110419 20:10:07 mysqld started110419 20:10:07 [Warning] option 'max_join_size': unsigned value 18446744073709551615 adjusted to 4294967295110419 20:10:07 [Warning] option 'max_join_size': unsigned value 18446744073709551615 adjusted to 4294967295110419 20:10:07 [Warning] The syntax for replication startup options is deprecated and will be removed in MySQL 5.2. Please use 'CHANGE MASTER' instead.110419 20:10:07 InnoDB: Started; log sequence number 0 43655110419 20:10:07 [Warning] Neither --relay-log nor --relay-log-index were used; so replication may break when this MySQL server acts as a slave and has his hostname changed!! Please use '--relay-log=centos188-relay-bin' to avoid this problem.
还有一个server-id = 1 的