-- Create CDC user with necessary privileges for Debezium
CREATE USER IF NOT EXISTS 'CDC_USER'@'%' IDENTIFIED BY 'CDC_PASSWORD';

-- Grant necessary privileges for CDC operations
GRANT SELECT ON DATAHUB_DB_NAME.* TO 'CDC_USER'@'%';
GRANT RELOAD ON *.* TO 'CDC_USER'@'%';
GRANT REPLICATION CLIENT ON *.* TO 'CDC_USER'@'%';
GRANT REPLICATION SLAVE ON *.* TO 'CDC_USER'@'%';

FLUSH PRIVILEGES;