Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/lonng/ticmp
Compare traffic between MySQL and TiDB
https://github.com/lonng/ticmp
Last synced: about 2 months ago
JSON representation
Compare traffic between MySQL and TiDB
- Host: GitHub
- URL: https://github.com/lonng/ticmp
- Owner: lonng
- License: apache-2.0
- Created: 2022-05-31T20:59:03.000Z (over 2 years ago)
- Default Branch: main
- Last Pushed: 2023-10-17T06:13:25.000Z (11 months ago)
- Last Synced: 2024-04-15T03:15:40.963Z (5 months ago)
- Language: Go
- Size: 4.42 MB
- Stars: 13
- Watchers: 3
- Forks: 5
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# TiCmp
Compare query results between MySQL and TiDB server.
## Usage
```
➜ ticmp git:(master) ✗ ./ticmp -h
Usage:
ticmp [flags]Flags:
-P, --port int Listen port of TiCmp shadow server (default 5001)
--user string TiCmp shadow server user name (default "root")
--pass string TiCmp shadow server password
--html string Output compare to specified html file
--csv string Output compare to specified csv file
--mysql.host string MySQL server host name (default "127.0.0.1")
--mysql.port int MySQL server port (default 3306)
--mysql.user string MySQL server user name (default "root")
--mysql.pass string MySQL server password
--mysql.name string MySQL server database name
--mysql.options string MySQL server connection options (default "charset=utf8mb4")
--tidb.host string TiDB server host name (default "127.0.0.1")
--tidb.port int TiDB server port (default 4000)
--tidb.user string TiDB server user name (default "root")
--tidb.pass string TiDB server password
--tidb.name string TiDB server database name
--tidb.options string TiDB server connection options (default "charset=utf8mb4")
-h, --help help for ticmp
```###
1. Run ticmp and connect to local MySQL/TiDB server
```shell
# Login local mysql server with user name: lonng
./ticmp --port 6000 --mysql.user lonng
```
2. Connect to ticmp and treat it as a normal MySQL server```shell
# Login into TiCmp server
mysql -h 127.0.0.1 -P 6000 -uroot# Query
mysql> select uuid();
+--------------------------------------+
| uuid() |
+--------------------------------------+
| bbfb289e-e125-11ec-b832-c8f6766ec590 |
+--------------------------------------+
1 row in set (0.01 sec)
```3. Check your TiCmp output and it should be like following content with diff highlight
```
QUERY > select uuid()
TiDB >
+--------------------------------------+
| uuid() |
+--------------------------------------+
| bbfb6642-e125-11ec-846a-acde48001122 |
+--------------------------------------+
MySQL >
+--------------------------------------+
| uuid() |
+--------------------------------------+
| bbfb289e-e125-11ec-b832-c8f6766ec590 |
+--------------------------------------+
```