how can I interface my c++ program with MySQL database?

As above, do I connect via some socket or what?
Get a MySQL library. A google search will turn up many different libs available. I've used MySQL++ in the past and it's pretty decent.

I don't know if it's the best though -- honesty the only other one I used was the "official" C++ connector package, but I never got it to work (and the API was way lamer)
Last edited on
sorry for bumping this thread but I have another question, the MySQL database has its own OFFICIAL native C API to interface with it(as opposed to third party libraries) as stated in the link I provided, am I correct?

http://ods.com.ua/win/eng/db/c_api/toc.html
Last edited on
there's an official C and an official C++ connector for MySQL. I've tried the C++ connector and was very disappointed with many of its design decisions (particularly that it forces everything to be dynamically allocated and it passes ownership of it around).

MySQL++ is basically a 3rd party C++ wrapper around the official C connector to make it easier to use in C++. I personally thought it did a much better job at it than the official C++ connector.
closed account (3hM2Nwbp)
You might find this page helpful: http://www.mysql.com/products/connector/
It says in the link
In addition, a native C library allows developers to embed MySQL directly into their applications.


1) which is the native C library?
this:
C Driver for MySQL (Connector/C)
or this:
C API for MySQL (mysqlclient)

and what is the difference between them?

2) btw, does the document in the following link use the native C API?
http://ods.com.ua/win/eng/db/c_api/toc.html

sorry for my noob questions.
Last edited on
Topic archived. No new replies allowed.