Skip to content

SciSharp/dotnet-mysql-replication

Folders and files

NameName
Last commit message
Last commit date

Latest commit

2a7bb55 · Apr 23, 2025
Apr 23, 2025
Nov 4, 2019
Apr 23, 2025
Apr 23, 2025
Oct 21, 2019
Oct 20, 2019
Sep 24, 2019
May 25, 2024
Oct 10, 2019
May 15, 2024

Repository files navigation

dotnet-mysql-replication

build MyGet Version NuGet Version

dotnet-mysql-replication is a C# Implementation of MySQL replication protocol client. This allows you to receive events like insert, update, delete with their data and raw SQL queries from MySQL.

Usage

using SciSharp.MySQL.Replication;

var serverHost = "localhost";
var username = "root";
var password = "scisharp";
var serverId =  1; // replication server id

var client = new ReplicationClient();
var result = await client.ConnectAsync(serverHost, username, password, serverId);

if (!result.Result)
{
    Console.WriteLine($"Failed to connect: {result.Message}.");
    return;
}

client.PackageHandler += (s, p) =>
{
    Console.WriteLine(p.ToString());
    Console.WriteLine();
}

client.StartReceive();

//...

await client.CloseAsync();