Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 8 additions & 8 deletions docker-compose-tests.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -19,17 +19,17 @@ services:
- ./tests_override.xml:/bitnami/clickhouse/etc/conf.d/override.xml:ro

mysql_db:
image: mysql/mysql-server:8.0.32
image: mysql:8.4.3
environment:
- MYSQL_DATABASE=admin
- MYSQL_ROOT_HOST=%
- MYSQL_ROOT_PASSWORD=admin
networks:
default:
MYSQL_DATABASE: admin
MYSQL_ROOT_HOST: "%"
MYSQL_ROOT_PASSWORD: admin
ports:
- 9306:3306
- "9306:3306"
volumes:
- ./test_mysql.cnf:/etc/my.cnf:ro
- ./test_mysql.cnf:/etc/mysql/my.cnf:ro
networks:
- default

mariadb_db:
image: mariadb:11.5.2
Expand Down
6 changes: 5 additions & 1 deletion mysql_ch_replicator/pymysqlreplication/binlogstream.py
Original file line number Diff line number Diff line change
Expand Up @@ -397,7 +397,11 @@ def __connect_to_stream(self):
# valid, if not, get the current position from master
if self.log_file is None or self.log_pos is None:
cur = self._stream_connection.cursor()
cur.execute("SHOW MASTER STATUS")
try:
cur.execute("SHOW MASTER STATUS")
except:
cur = self._stream_connection.cursor()
cur.execute("SHOW BINARY LOG STATUS")
master_status = cur.fetchone()
if master_status is None:
raise BinLogNotEnabled()
Expand Down
2 changes: 1 addition & 1 deletion mysql_ch_replicator/runner.py
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ def restart_dead_processes(self):
def restart_replication_if_required(self):
if not self.need_restart_replication:
return
logger.info('\n\n\n ====== restarting replication =====')
logger.info('restarting replication')
for db_name, runner in self.runners.items():
logger.info(f'stopping runner {db_name}')
runner.stop()
Expand Down
5 changes: 3 additions & 2 deletions test_mysql.cnf
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,9 @@ user = mysql
# Custom settings
collation-server = utf8mb4_0900_ai_ci
character-set-server = utf8mb4
default_authentication_plugin = mysql_native_password
#default_authentication_plugin = mysql_native_password
init-connect = 'SET NAMES utf8mb4'
skip-host-cache
#skip-host-cache
skip-name-resolve
information_schema_stats_expiry = 0

Expand All @@ -27,3 +27,4 @@ enforce_gtid_consistency = 1
binlog_expire_logs_seconds = 864000
max_binlog_size = 500M
binlog_format = ROW #Very important if you want to receive write, update and delete row events
log-bin = mysql-bin
Loading