Recently I'm trying to build a tool to synchronize data between databases using binlog. The way to do this is kind of like, the tool pretends to be a MySQL server and then communicates with a real MySQL server via MySQL C/S protocol. I went to github, and found some tools that Do the same thing, so I started to read their codes.
The problem is, these tools are using some header files include m_ctype.h
sql_common.h
.I have libmysqlclient-dev
installed, but these headers are not in /usr/local/includ
. Basically I want to use simple_command()
, which is a macro in these files, to send data packages to the real server.
Then I found these files are in the source codes of MySQL. So how can I get these headers and make these functions and macros work? Should I :
- copy these files to include folder and link to libmysqlclient like mysql_config shows
- install another lib, maybe libmysql or something, and then I will get the headers and make things work
or Do any other things?
If there are other ways to implement MySQL c/s protocol, that will be fine, too.
I checked files of libmysqlclient-dev listed on ubuntu package, and I found that the lib I installed following instructions on dev.mysql.com has a lot of headers missing, include my_global.h
my_config.h
etc. Is this because i'm using MySQL's apt source? Or for some other reasons?