Link to home
Start Free TrialLog in
Avatar of lin fox
lin fox

asked on

MYSQL relication -- unable to connect to master

Hello ,
I am setting up mysql replication between a master and slave and I get the error "error connecting to master".

Before i have this error 1045, i use this solution tutorial:
https://www.howtoforge.com/how-to-repair-mysql-replication
After that have nothing change.
I tried to change my password form the slave-user but nothing change.

I have in the my.ini datei on slave the id=2 and on master the id=1

 i have the user for the replication in the php-admin and i gave him the right for the replication.

The Port: 3306 is open:

Starting portqry.exe -n 11.1.1.1.1.11 -e 3306 -p TCP ...

Querying target system called:

1.1.1.1.1.1

Attempting to resolve IP address to a name...

IP address resolved to master.net

querying...

TCP port 3306 (unknown service): LISTENING
portqry.exe -n 11.11..1.11.1 -e 3306 -p TCP exits with return code 0x00000000.

How i can test the rights best about the user slave?


mysql> SHOW SLAVE STATUS \G;
* 1. row *
Slave_IO_State: Connecting to master
Master_Host: Master.host.net
Master_User: slave_sync
Master_Port: 3306
Connect_Retry: 60
Master_Log_File: mysql-bin.000005
Read_Master_Log_Pos: 8127820
Relay_Log_File: relay.000024
Relay_Log_Pos: 4
Relay_Master_Log_File: mysql-bin.000005
Slave_IO_Running: Connecting
Slave_SQL_Running: Yes
Replicate_Do_DB: db_01
Replicate_Ignore_DB:
Replicate_Do_Table:
Replicate_Ignore_Table:
Replicate_Wild_Do_Table:
Replicate_Wild_Ignore_Table:
Last_Errno: 0
Last_Error:
Skip_Counter: 0
Exec_Master_Log_Pos: 8127820
Relay_Log_Space: 154
Until_Condition: None
Until_Log_File:
Until_Log_Pos: 0
Master_SSL_Allowed: Yes
Master_SSL_CA_File: D:/mysql/cert/ca-cert.pem
Master_SSL_CA_Path:
Master_SSL_Cert: D:/mysql/cert/client-cert.pem
Master_SSL_Cipher:
Master_SSL_Key: D:/mysql/cert/client-key.pem
Seconds_Behind_Master: NULL
Master_SSL_Verify_Server_Cert: No
Last_IO_Errno: 1045
Last_IO_Error: error connecting to master 'slave_sync@master.host.net:3306' - retry-time: 60 retries: 3988
Last_SQL_Errno: 0
Last_SQL_Error:
Replicate_Ignore_Server_Ids:
Master_Server_Id: 0
Master_UUID: ***
Master_Info_File: C:\ProgramData\MySQL\MySQL Server 5.7\Data\master
.info
SQL_Delay: 0
SQL_Remaining_Delay: NULL
Slave_SQL_Running_State: Slave has read all relay log; waiting for more up
dates
Master_Retry_Count: 86400
Master_Bind:
Last_IO_Error_Timestamp: 170724 09:12:49
Last_SQL_Error_Timestamp:
Master_SSL_Crl:
Master_SSL_Crlpath:
Retrieved_Gtid_Set:
Executed_Gtid_Set:
Auto_Position: 0
Replicate_Rewrite_DB:
Channel_Name:
Master_TLS_Version:
1 row in set (0.00 sec)

ERROR:
No query specified



The protocol:

2017-07-11T07:06:02.469999Z 0 [Note] C:\Program Files\MySQL\MySQL Server 5.7\bin\mysqld.exe: Shutdown complete

2017-07-11T07:08:11.515063Z 0 [Warning] TIMESTAMP with implicit DEFAULT value is deprecated. Please use --explicit_defaults_for_timestamp server option (see documentation for more details).
2017-07-11T07:08:11.595055Z 0 [Warning] 'NO_ZERO_DATE', 'NO_ZERO_IN_DATE' and 'ERROR_FOR_DIVISION_BY_ZERO' sql modes should be used with strict mode. They will be merged with strict mode in a future release.
2017-07-11T07:08:11.655868Z 0 [Note] C:\Program Files\MySQL\MySQL Server 5.7\bin\mysqld.exe (mysqld 5.7.16-log) starting as process 1392 ...
2017-07-11T07:08:12.483227Z 0 [Note] InnoDB: Mutexes and rw_locks use Windows interlocked functions
2017-07-11T07:08:12.483227Z 0 [Note] InnoDB: Uses event mutexes
2017-07-11T07:08:12.483227Z 0 [Note] InnoDB: _mm_lfence() and _mm_sfence() are used for memory barrier
2017-07-11T07:08:12.483227Z 0 [Note] InnoDB: Compressed tables use zlib 1.2.3
2017-07-11T07:08:12.483227Z 0 [Note] InnoDB: Adjusting innodb_buffer_pool_instances from 8 to 1 since innodb_buffer_pool_size is less than 1024 MiB
2017-07-11T07:08:12.498889Z 0 [Note] InnoDB: Number of pools: 1
2017-07-11T07:08:12.514494Z 0 [Note] InnoDB: Not using CPU crc32 instructions
2017-07-11T07:08:12.561416Z 0 [Note] InnoDB: Initializing buffer pool, total size = 8M, instances = 1, chunk size = 8M
2017-07-11T07:08:12.577042Z 0 [Note] InnoDB: Completed initialization of buffer pool
2017-07-11T07:08:12.670743Z 0 [Note] InnoDB: Highest supported file format is Barracuda.
2017-07-11T07:08:13.576052Z 0 [Note] InnoDB: Creating shared tablespace for temporary tables
2017-07-11T07:08:13.591674Z 0 [Note] InnoDB: Setting file '.\ibtmp1' size to 12 MB. Physically writing the file full; Please wait ...
2017-07-11T07:08:13.826070Z 0 [Note] InnoDB: File '.\ibtmp1' size is now 12 MB.
2017-07-11T07:08:13.841695Z 0 [Note] InnoDB: 96 redo rollback segment(s) found. 96 redo rollback segment(s) are active.
2017-07-11T07:08:13.841695Z 0 [Note] InnoDB: 32 non-redo rollback segment(s) are active.
2017-07-11T07:08:13.841695Z 0 [Note] InnoDB: Waiting for purge to start
2017-07-11T07:08:13.935454Z 0 [Note] InnoDB: 5.7.16 started; log sequence number 4406933
2017-07-11T07:08:13.951075Z 0 [Note] InnoDB: Loading buffer pool(s) from C:\ProgramData\MySQL\MySQL Server 5.7\Data\ib_buffer_pool
2017-07-11T07:08:13.951075Z 0 [Note] Plugin 'FEDERATED' is disabled.
2017-07-11T07:08:14.686159Z 0 [Note] InnoDB: Buffer pool(s) load completed at 170711  9:08:14
2017-07-11T07:08:15.139849Z 0 [Warning] Failed to set up SSL because of the following SSL library error: SSL context is not usable without certificate and private key
2017-07-11T07:08:15.139849Z 0 [Note] Server hostname (bind-address): '*'; port: 3306
2017-07-11T07:08:15.139849Z 0 [Note] IPv6 is available.
2017-07-11T07:08:15.139849Z 0 [Note]   - '::' resolves to '::';
2017-07-11T07:08:15.139849Z 0 [Note] Server socket created on IP: '::'.
2017-07-11T07:08:16.766661Z 1 [Warning] Storing MySQL user name or password information in the master info repository is not secure and is therefore not recommended. Please consider using the USER and PASSWORD connection options for START SLAVE; see the 'START SLAVE Syntax' in the MySQL Manual for more information.
2017-07-11T07:08:16.860419Z 2 [Warning] Slave SQL for channel '': If a crash happens this configuration does not guarantee that the relay log info will be consistent, Error_code: 0
2017-07-11T07:08:16.860419Z 2 [Note] Slave SQL thread for channel '' initialized, starting replication in log 'mysql-bin.000005' at position 466159, relay log 'D:\mysql\relay.000018' position: 29679
2017-07-11T07:08:16.954156Z 1 Slave I/O for channel '': error connecting to master 'slave_sync@.net:3306' - retry-time: 60  retries: 1, Error_code: 1045
2017-07-11T07:08:17.032276Z 2 Slave SQL for channel '': Could not execute Write_rows event on table db01.auth_codes; Duplicate entry '4' for key 'PRIMARY', Error_code: 1062; handler error HA_ERR_FOUND_DUPP_KEY; the event's master log mysql-bin.000005, end_log_pos 466475, Error_code: 1062
2017-07-11T07:08:17.032276Z 2 [Warning] Slave: Duplicate entry '4' for key 'PRIMARY' Error_code: 1062
2017-07-11T07:08:17.032276Z 2 Error running query, slave SQL thread aborted. Fix the problem, and restart the slave SQL thread with "SLAVE START". We stopped at log 'mysql-bin.000005' position 466159
2017-07-11T07:08:17.626489Z 0 [Note] Event Scheduler: Loaded 0 events
2017-07-11T07:08:17.626489Z 0 [Note] C:\Program Files\MySQL\MySQL Server 5.7\bin\mysqld.exe: ready for connections.
Version: '5.7.16-log'  socket: ''  port: 3306  MySQL Community Server (GPL)
2017-07-11T07:09:17.056238Z 1 Slave I/O for channel '': error connecting to master 'slave_sync@111111.master.net:3306' - retry-time: 60  retries: 2, Error_code: 1045
2017-07-11T07:10:17.170046Z 1 Slave I/O for channel '': error connecting to master 'slave_sync@111111.master.net:3306' - retry-time: 60  retries: 3, Error_code: 1045
2017-07-11T07:11:17.268214Z 1 Slave I/O for channel '': error connecting to master 'slave_sync@111111.master.net:3306' - retry-time: 60  retries: 4, Error_code: 1045
2017-07-11T07:12:17.385544Z 1 Slave I/O for channel '': error connecting to master 'slave_sync@111111.master.net:3306' - retry-time: 60  retries: 5, Error_code: 1045
2017-07-11T07:13:17.500360Z 1 Slave I/O for channel '': error connecting to master 'slave_sync@111111.master.net:3306' - retry-time: 60  retries: 6, Error_code: 1045
2017-07-11T07:14:17.598731Z 1 Slave I/O for channel '': error connecting to master 'slave_sync@111111.master.net:3306' - retry-time: 60  retries: 7, Error_code: 1045
2017-07-11T07:15:17.745838Z 1 Slave I/O for channel '': error connecting to master 'slave_sync@111111.master.net:3306' - retry-time: 60  retries: 8, Error_code: 1045
2017-07-11T07:16:17.897276Z 1 Slave I/O for channel '': error connecting to master 'slave_sync@111111.master.net:3306' - retry-time: 60  retries: 9, Error_code: 1045
2017-07-11T07:17:18.042295Z 1 Slave I/O for channel '': error connecting to master 'slave_sync@111111.master.net:3306' - retry-time: 60  retries: 10, Error_code: 1045
2017-07-11T07:18:18.172884Z 1 Slave I/O for channel '': error connecting to master 'slave_sync@111111.master.net:3306' - retry-time: 60  retries: 11, Error_code: 1045
2017-07-11T07:19:18.302311Z 1 Slave I/O for channel '': error connecting to master 'slave_sync@111111.master.net:3306' - retry-time: 60  retries: 12, Error_code: 1045
2017-07-11T07:20:18.448763Z 1 Slave I/O for channel '': error connecting to master 'slave_sync@111111.master.net:3306' - retry-time: 60  retries: 13, Error_code: 1045
2017-07-11T07:21:18.598929Z 1 Slave I/O for channel '': error connecting to master 'slave_sync@111111.master.net:3306' - retry-time: 60  retries: 14, Error_code: 1045
2017-07-11T07:22:18.747234Z 1 Slave I/O for channel '': error connecting to master 'slave_sync@111111.master.net:3306' - retry-time: 60  retries: 15, Error_code: 1045
2017-07-11T07:23:18.895107Z 1 Slave I/O for channel '': error connecting to master 'slave_sync@111111.master.net:3306' - retry-time: 60  retries: 16, Error_code: 1045
2017-07-11T07:24:19.042544Z 1 Slave I/O for channel '': error connecting to master 'slave_sync@111111.master.net:3306' - retry-time: 60  retries: 17, Error_code: 1045
2017-07-11T07:25:19.187594Z 1 Slave I/O for channel '': error connecting to master 'slave_sync@111111.master.net:3306' - retry-time: 60  retries: 18, Error_code: 1045
Avatar of lin fox
lin fox

ASKER

I have no idea, how i can run this mysql replikation again...


who i can show and what can i do...

i think its because i change the password ...


other because i use the another solution....
Avatar of lin fox

ASKER

i say yet the user use not a password and after that, its have nothing change
Avatar of lin fox

ASKER

ysql> SHOW MASTER STATUS;
------------------+----------+--------------+------------------+---------------
---+
 File             | Position | Binlog_Do_DB | Binlog_Ignore_DB | Executed_Gtid_
et |
------------------+----------+--------------+------------------+---------------
---+
 mysql-bin.000012 |      154 |              |                  |
   |
------------------+----------+--------------+------------------+---------------
---+
Avatar of arnold
Are you following the MySQL guide for replications?
Are you able from the slave system connect to the master
mysql -u user -p -h master_server databasename
Make sure if you gave firewalld/iptables enabled that you allow access to port 3306
When you created the replication user did you include the slave server as the host from which it will connect?
Replication@localhost
Replication@slaveserver

Are separate users...
Avatar of lin fox

ASKER

So i know what was the mistake...

the password in the masterinfo was not correct...

And i forget, if i change the password in mysql workbench and in phpadmin...i need to change the password in the master.info datei

The slave its connected with the master server again but i have a another status and its dont worked...:

Error-log:
1.
2017-07-25T13:55:36.128920Z 26 [ERROR] Slave I/O for channel '': error connecting to master 'slave@master.net:3306' - retry-time: 60  retries: 10, Error_code: 1045 
02.
2017-07-25T13:56:36.274079Z 26 [ERROR] Slave I/O for channel '': error connecting to master 'slave@master.net:3306' - retry-time: 60  retries: 11, Error_code: 1045 
03.
2017-07-25T13:57:36.419311Z 26 [ERROR] Slave I/O for channel '': error connecting to master 'slave@master.net:3306' - retry-time: 60  retries: 12, Error_code: 1045 
04.
2017-07-25T13:58:36.564484Z 26 [ERROR] Slave I/O for channel '': error connecting to master 'slave@master.net:3306' - retry-time: 60  retries: 13, Error_code: 1045 
05.
2017-07-25T13:59:36.710286Z 26 [ERROR] Slave I/O for channel '': error connecting to master 'slave@master.net:3306' - retry-time: 60  retries: 14, Error_code: 1045 
06.
2017-07-25T14:00:36.855891Z 26 [ERROR] Slave I/O for channel '': error connecting to master 'slave@master.net:3306' - retry-time: 60  retries: 15, Error_code: 1045 
07.
2017-07-25T14:01:37.003710Z 26 [ERROR] Slave I/O for channel '': error connecting to master 'slave@master.net:3306' - retry-time: 60  retries: 16, Error_code: 1045 
08.
2017-07-25T14:02:37.151074Z 26 [ERROR] Slave I/O for channel '': error connecting to master 'slave@master.net:3306' - retry-time: 60  retries: 17, Error_code: 1045 
09.
2017-07-25T14:03:37.298221Z 26 [ERROR] Slave I/O for channel '': error connecting to master 'slave@master.net:3306' - retry-time: 60  retries: 18, Error_code: 1045 
10.
2017-07-25T14:04:37.448022Z 26 [Note] Slave I/O thread for channel '': connected to master 'slave@master.net:3306',replication started in log 'mysql-bin.000005' at position 8127820 
11.
2017-07-25T14:06:03.267128Z 27 [Note] Slave SQL thread for channel '' exiting, replication stopped in log 'mysql-bin.000005' at position 9080452 
12.
2017-07-25T14:06:03.329635Z 26 [Note] Slave I/O thread killed while reading event for channel '' 
13.
2017-07-25T14:06:03.329635Z 26 [Note] Slave I/O thread exiting for channel '', read up to log 'mysql-bin.000005', position 15250145 
14.
2017-07-25T14:06:08.111245Z 35 [Warning] Storing MySQL user name or password information in the master info repository is not secure and is therefore not recommended. Please consider using the USER and PASSWORD connection options for START SLAVE; see the 'START SLAVE Syntax' in the MySQL Manual for more information. 
15.
2017-07-25T14:06:08.126868Z 36 [Warning] Slave SQL for channel '': If a crash happens this configuration does not guarantee that the relay log info will be consistent, Error_code: 0 
16.
2017-07-25T14:06:08.126868Z 36 [Note] Slave SQL thread for channel '' initialized, starting replication in log 'mysql-bin.000005' at position 9080452, relay log 'D:\mysql\relay.000003' position: 952952 
17.
2017-07-25T14:06:08.251878Z 35 [Note] Slave I/O thread for channel '': connected to master 'slave@master.net:3306',replication started in log 'mysql-bin.000005' at position 15250145 
18.
2017-07-25T14:32:24.146006Z 36 [Note] Error reading relay log event for channel '': slave SQL thread was killed 
19.
2017-07-25T14:32:24.192884Z 35 [Note] Slave I/O thread killed while reading event for channel '' 
20.
2017-07-25T14:32:24.192884Z 35 [Note] Slave I/O thread exiting for channel '', read up to log 'mysql-bin.000005', position 15250719 
21.
2017-07-25T14:32:43.071421Z 57 [Warning] Storing MySQL user name or password information in the master info repository is not secure and is therefore not recommended. Please consider using the USER and PASSWORD connection options for START SLAVE; see the 'START SLAVE Syntax' in the MySQL Manual for more information. 
22.
2017-07-25T14:32:43.087016Z 58 [Warning] Slave SQL for channel '': If a crash happens this configuration does not guarantee that the relay log info will be consistent, Error_code: 0 
23.
2017-07-25T14:32:43.087016Z 58 [Note] Slave SQL thread for channel '' initialized, starting replication in log 'mysql-bin.000005' at position 15250719, relay log 'D:\mysql\relay.000004' position: 894 
24.
2017-07-25T14:32:43.212056Z 57 [Note] Slave I/O thread for channel '': connected to master 'slave@master.net:3306',replication started in log 'mysql-bin.000005' at position 15250719 
25.
2017-07-25T14:37:26.890592Z 58 [Note] Error reading relay log event for channel '': slave SQL thread was killed 
26.
2017-07-25T14:37:26.921844Z 57 [Note] Slave I/O thread killed while reading event for channel '' 
27.
2017-07-25T14:37:26.921844Z 57 [Note] Slave I/O thread exiting for channel '', read up to log 'mysql-bin.000005', position 15250719 
28.
2017-07-25T15:06:40.108943Z 91 [Warning] Storing MySQL user name or password information in the master info repository is not secure and is therefore not recommended. Please consider using the USER and PASSWORD connection options for START SLAVE; see the 'START SLAVE Syntax' in the MySQL Manual for more information. 
29.
2017-07-25T15:06:40.140195Z 92 [Warning] Slave SQL for channel '': If a crash happens this configuration does not guarantee that the relay log info will be consistent, Error_code: 0 
30.
2017-07-25T15:06:40.140195Z 92 [Note] Slave SQL thread for channel '' initialized, starting replication in log 'mysql-bin.000005' at position 15250719, relay log 'D:\mysql\relay.000005' position: 320 
31.
2017-07-25T15:06:40.249547Z 91 [Note] Slave I/O thread for channel '': connected to master 

Open in new window


The new Slave Status :
mysql> SHOW SLAVE STATUS \G;
* 1. row *
Slave_IO_State: Waiting for master to send event
Master_Host: 32498234master.net
Master_User: slave_sync
Master_Port: 3306
Connect_Retry: 60
Master_Log_File: mysql-bin.000005
Read_Master_Log_Pos: 15252340
Relay_Log_File: relay.000006
Relay_Log_Pos: 1941
Relay_Master_Log_File: mysql-bin.000005
Slave_IO_Running: Yes
Slave_SQL_Running: Yes
Replicate_Do_DB: db01
Replicate_Ignore_DB:
Replicate_Do_Table:
Replicate_Ignore_Table:
Replicate_Wild_Do_Table:
Replicate_Wild_Ignore_Table:
Last_Errno: 0
Last_Error:
Skip_Counter: 0
Exec_Master_Log_Pos: 15252340
Relay_Log_Space: 2304
Until_Condition: None
Until_Log_File:
Until_Log_Pos: 0
Master_SSL_Allowed: Yes
Master_SSL_CA_File: D:/mysql/cert/ca-cert.pem
Master_SSL_CA_Path:
Master_SSL_Cert: D:/mysql/cert/client-cert.pem
Master_SSL_Cipher:
Master_SSL_Key: D:/mysql/cert/client-key.pem
Seconds_Behind_Master: 0
Master_SSL_Verify_Server_Cert: No
Last_IO_Errno: 0
Last_IO_Error:
Last_SQL_Errno: 0
Last_SQL_Error:
Replicate_Ignore_Server_Ids:
Master_Server_Id: 1
Master_UUID: f6f77101-a9d8-11e6-93b2-0cc47ac69bea
Master_Info_File: C:\ProgramData\MySQL\MySQL Server 5.7\Data\master
.info
SQL_Delay: 0
SQL_Remaining_Delay: NULL
Slave_SQL_Running_State: Slave has read all relay log; waiting for more up
dates
Master_Retry_Count: 86400
Master_Bind:
Last_IO_Error_Timestamp:
Last_SQL_Error_Timestamp:
Master_SSL_Crl:
Master_SSL_Crlpath:
Retrieved_Gtid_Set:
Executed_Gtid_Set:
Auto_Position: 0
Replicate_Rewrite_DB:
Channel_Name:
Master_TLS_Version:
1 row in set (0.00 sec)

ERROR:
No query specified

Open in new window


Master Status:
mysql> SHOW MASTER STATUS;
+------------------+----------+--------------+------------------+---------------
----+
| File | Position | Binlog_Do_DB | Binlog_Ignore_DB | Executed_Gtid_
Set |
+------------------+----------+--------------+------------------+---------------
----+
| mysql-bin.000012 | 154 | | |
|
+------------------+----------+--------------+------------------+---------------
----+
1 row in set (0.00 sec)

mysql> 

Open in new window


i think is because the binar-log datei...the master and slave use different binar-logs..or i am false with that?
Avatar of lin fox

ASKER

What mean this error?:

Timestamp, Thread, Type, Details
2017-07-25T15:06:40, 92, Warning, Slave SQL for channel '': If a crash happens this configuration does not guarantee that the relay log info will be consistent, Error_code: 0
Avatar of lin fox

ASKER

Ok, i know yet the mistake...the database of the slave server is inkonsistent and i need to reset my database of the slave-server....i need first copy the master-database again of the slave...
i have the slave-server in my local host data and i was to test the slave "website", but this make the "logging-log" in the database inkonsitent...
How are you copying, taking a backup of the master, restoring it on the slave?
That is the process to get the slave db setup for replication.

Copying of files is not the correct way.

Also on the slave,
Show slave status;
Potentially list the errors it has ...
Avatar of lin fox

ASKER

First  i delete the old database of the slave. secound I make a export form the master database and after that i import the master database of the slave. Before i make the export, i should make the mysql services to stop...

How would you to do it, please ?

And thank you for time. :)
Usually, you should not manually delete/copy database files.
On the slave run
mysqldump -u replicationuser -p -h masterserver -d database >masterserver.bak
Look to see what you have
cat masterserver.bak| mysql -u root -p
This will restore the DB from backup.
OH, you then have to reinitialize the replication setup on the slave. Deals with resetting the bin log it needs ...
You do not make any changes on the master, only the slave server needs to be refreshed.
Avatar of lin fox

ASKER

yeah...

you see the new error yet, what i was posting? ...

the replikcation work but she dont to snychron...

one extern admin said to me, if its because i write the slave on the master and because this are the data not more consistent...
he said to me, i need to refresh the master and the slave again...
and to import the master.sql to the slave database...
after that its should working again...
Avatar of lin fox

ASKER

the slave server was the mistake ...not the master!

a make first a dump form the master database and after that i export the datbase on the slave database...

i mean with the "refresh" a restart...

and after that they should again to snychron...because the databases are same ...and not more inconsistent...

(sorry for my bad english)

i hope you can follow me
No, restart is not the way to recover from an issue, each maintain a reference file, a restart does not clear the previously detected error.

You can not write on the slave.
To have the option to write on either and have the replicate, your setup must be a master/master
You need to adjust the increment and offset to make sure each server assigns unique IDS.

System A.  System B
Master.        Slave
Slave.            Master

Circular replication.

Both are a master and a slave.

auto_increment_increment this is the step this should be the same, 10 20
auto_increment_offset master shoukd have 1 while slave 2

With this it is impossible for the two systems to ever issue an ID that is not unique.
Master 1,11,21,31 for a step of 10
Slave 2,12,22,32 ..

Since you are adding to an existing, you have to see what the current Max ids are in your master db, and adjust the offset (starting point) above the largest number so new entries will be unique.

Master/slave are commonly setup for a hot backup, data only written to one, while reporting/data reads can be offloaded to the slave.


You have to define what it is you are after...

In a master/master you must monitor the slave instance status on both to make sure they are syncing....
Avatar of lin fox

ASKER

So again...what i want so say it is...

i make a mistake...for short time i was the slave the master....

because in my host-file  i set the ip form the slave. on my computer,..because i was testing local my website on the slave..

after i work with my ip from slave on the database form the master...

just the view "can" with my "slave-ip" make the database inconnsistent, because the php logging datei set a douple id and the database say I already have it...and because this small "inconnsistent" and make a break. th
its not easy to describe the problem...for me its ne
and the insert is  dont working..because he have already the ID...

1. he said...i can set manuell the new datebase contributions-changes on the slave and after that its work or..
2. i set the database on the slave new form the master...)
Using the auto-increment-increment and auto-increment-offset in the /etc/my.cnf (MySQL setting file) as described you eliminate the possibility of non-unique Ids.

Given the situation, after you reset the replication by backing up the master database, loosing the slave data.

What is it you want your setup to do?

Instead of trying to undo what you have and try to ...

I am trying to understand what you are after.
Avatar of lin fox

ASKER

but the id is right....i have a Hot-Backup (Slave/master) ...

i am at the work...i need more time to wirte ...
This question needs an answer!
Become an EE member today
7 DAY FREE TRIAL
Members can start a 7-Day Free trial then enjoy unlimited access to the platform.
View membership options
or
Learn why we charge membership fees
We get it - no one likes a content blocker. Take one extra minute and find out why we block content.