I\'m getting \"undefined reference to \'get_driver_instance\'\" when building even the most simple example from: http://dev.mysql.com/doc/refman/5.1/en/connector-cpp-example
try adding -lmysqlcppconn to your linker options. I answered just for this to have an answer (even though this was asked 2 years ago :D)
-lmysqlcppconn