Weird behaviour of mysql-connector-c++ in OSX I'm developing an application in c++ in OSX Yosemite that uses mysql. I've installed both mysql and mysql-connector-c++ using brew. 

I could use the library without any problems until recently, butnow I'm having some problems. 

Basically, when I try to run my application I get the following error:

libc++abi.dylib: terminating with uncaught exception of type 
sql::SQLException: Unknown MySQL server host 'K@??' (0)


I've checked and I'm correctly passing the host name, which is localhost. I've tried to reinstall mysql-connector-c++ but the problem remains. Does anyone have any idea on how to fix this?

I'm using mysql version 5.7.14 and mysql-connector-c++ version 1.1.6_1.
I also got this problem. I guess the reason is the mismatch between macos and mysqlconn. The latest mysqlconn binary release only supports up to macos 10.10 and the latest macos is 10.11. I compiled the driver myself and the issue has gone. So you can try to compile that yourself and it should work. Here are the commands I used:

cmake -DMYSQL_CONFIG_EXECUTABLE=/usr/local/Cellar/mysql/5.7.15/bin/mysql_config -DCMAKE_INSTALL_PREFIX=~/
make;make install


Then you can just include ~/include and ~/lib for your header and libs. Hope this works for you. If this still does not work, try to check whether you used the same gcc for both mysqlconn and your program. brew now installs gcc 6.2 but mac only carries 4.2.