views:

440

answers:

7

I'm running OSX(10.4.11) & I'm trying to get a decent C(preferably C++) binding for MySQL figured out. I have some data in an offsite database I want to analyze.

I'm trying to get MySQL++ working, but it's being funky.

I'm looking for other bindings, preferably ones with a no-headache install.

edit:

MySQL has C bindings. Clunky and low-level, but it works(after some library fiddling).

http://www.sqlapi.com/ supports Solaris/Windows/Linux.

A: 

You might want to look at SOCI. Although it builds upon the MySQL C API, it presents a much nicer C++-friendly interface than using the C bindings.

Dean Michael
A: 

There is mysql++. I've used it with one of our c++ projects.

A: 

How is MySQL++ being funky for you?

KernelM
A: 

Personally I've used mymysql in the past (still do if I'm working in C++) it's a lightweight wrapper around the C api and ties memory management to object lifetimes.

It can be found here: http://www.redi.uklinux.net/mymysql/

Despite the warnings on the site, it's still not a bad library. It was actually written by a former colleague and despite him not really maintining it anymore it's still in fairly good shape.

Dan Head
A: 

I've never had any problems using the MySQL C library.

Avi
+1  A: 

MySQL Connector/C++ is a C++ implementation of JDBC 4.0

The reference customers who use MySQL Connector/C++ are: - OpenOffice - MySQL Workbench

Learn more: http://forums.mysql.com/read.php?167,221298

A: 

The SQLApi++ has been ported to OS/X by this guy, as part of a REALBasic plugin. He may be open to licensing it.

I don't know why it hasn't been licensed back to them. Maybe they are not interested in supporting Mac clients.

Andy Dent