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 to add '-lmysqlclient' to the command, i.e.: g++ -o test -Iinclude -Llib -L/usr/lib64/mysql -lmysqlclient main.cpp
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