A pure Go library for MySQL network protocol handling, replication, and client/server implementations.
go-mysql is a pure Go library that implements the MySQL network protocol and replication handling. It provides tools for building applications that require direct MySQL communication, such as acting as a replica to sync binlog events, creating custom MySQL servers or proxies, and syncing data to external systems. The library solves the problem of interacting with MySQL and MariaDB servers at the protocol level without relying on C bindings.
Go developers building applications that need low-level MySQL protocol interaction, such as data synchronization tools, custom MySQL proxies, replication clients, or mock servers. It is also suitable for developers who require a pure Go MySQL driver with advanced features like streaming and connection pooling.
Developers choose go-mysql because it is a comprehensive, dependency-free Go library that offers unique capabilities like binlog replication handling, a fake MySQL server implementation, and incremental data syncing via Canal. Its pure Go nature ensures cross-platform compatibility and avoids the complexities of C dependencies.
a powerful mysql toolset with Go
Open-Awesome is built by the community, for the community. Submit a project, suggest an awesome list, or help improve the catalog on GitHub.
As a pure Go library, it avoids C dependencies and supports multiple OS and architectures like Linux amd64/s390x/arm64 and FreeBSD, ensuring portability without external bindings.
Implements MySQL replication protocol with GTID sync and MariaDB 11.4+ compatibility via the FillZeroLogPos option, enabling reliable binlog event streaming for data synchronization.
The Canal package allows incremental data dumping and syncing to external systems like Elasticsearch, as demonstrated in the go-mysql-elasticsearch project, using binlog streaming.
Provides a fake MySQL server implementation that handles MySQL client connections, useful for building custom proxies or mock servers, with support for multiple authentication methods.
Requires explicit FillZeroLogPos configuration for accurate binlog position tracking in MariaDB 11.4+, adding an extra step and potential for misconfiguration in replication setups.
CI testing is incomplete for some platforms like arm and FreeBSD, which are only sporadically tested, potentially leading to undiscovered issues in those environments.
Assumes deep knowledge of MySQL internals, such as binlog formats and replication protocols, making it challenging for developers without that background to implement effectively.