MySQL Connector for C++ | MySQL_Connection::setReadOnly() exception on setSchema

青春壹個敷衍的年華 提交于 2019-12-06 06:04:52

I had a similar problem, though on Debian Wheezy, with version 1.1.0-4+b1:

Example of usage:

sql::Connection *con; 
con->setSchema(mysql_schema);

Which throws:

MySQL_Connection::setReadOnly()

By replacing Connector/C++ 1.1.0-4+b1 with 1.1.5, it no longer throws this error.

I've had the same problem; it turned out to be because I was linking the 64-bit version of Connector/C++ to my compiled-as-32-bit program.

yes,please use v1.1.5. the version of 1.16 has bug.

tar -xf mysql-connector-c++-1.1.5.tar.gz
cd mysql-connector-c++-1.1.5
cmake . -DMYSQL_CONFIG_EXECUTABLE=/usr/local/mysql/bin/mysql_config \
  -DMYSQL_LIB=/usr/local/mysql/lib/libmysqlclient.so
make
sudo make install
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!