mysql++

how to set mysql_ping timeout with MySQL++

假如想象 提交于 2019-12-24 10:36:35
问题 I want mysql_ping to timeout in matter of seconds. In the testcase below if a connection is established followed by "ifconfig eth0 down" the false side of conn.ping() is never reached. The thread/process enters what seems like an endless wait. I want to change this and make it timeout faster, preferably using MySQL++ options. Any idea which option that might be ? Maybe I also need to set how many times it will retry ? Reading up on the documentation for MySQL, it tells us mysql_ping will try

Avoiding conflicting declaration errors in typedef c++

余生颓废 提交于 2019-12-23 18:45:57
问题 Is there a way I can make g++ ignore or work around conflicting typedefs? Background: I'm writing some c++ code for the gridlab_d simulator. My model needs to connect to a c++ database, so I'm using the mysql++ library. use of the mysql++ library requires me to link to the mysql library, so i compile with g++ -I/usr/include/mysql -I/usr/local/include/mysql++ Problem: both mysql.h and list.h in gridlab typedef a struct to have the name LIST . Here is the compiler error In file included from

Setting up Mysql++ in linux

北战南征 提交于 2019-12-21 01:46:07
问题 I want to connect to a mysql database with C++ in linux. On my local machine I am running Ubuntu, and installed the mysql server and client packages: sudo apt-get install mysql-server mysql-client I came across Mysql++ but have some problems when running ./configure from their binary package. The error says: checking for MySQL library directory... configure: error: Didn't find mysqlclient library in '/usr/lib64 /usr/lib /usr/lib64/mysql /usr/lib/mysql /usr/local/lib64 /usr/local/lib /usr

mysql and c — use variable in query

孤者浪人 提交于 2019-12-13 07:40:16
问题 I'm writing a c program with an mysql database connection and I'm having difficulties creating my mysql queries... i want to you a variable integer in my mysql query, but i can't seem to get i right... my current query looks like this... mysql_query(conn, "INSERT INTO markerherkenning (MARKER_ID, DATETIME) values(1, CURRENT_TIME())"); my marker_ID value should be a variable value, so i can reduce my code... i have used this guide to get me going... (http://zetcode.com/tutorials

allocate more memory to void * on iteration and then add the value

混江龙づ霸主 提交于 2019-12-13 05:37:22
问题 I have a memory allocation problem with an implementation of a column-store database system. This, in particular is part of implementing a MySql connector to import a table into my database. Say I have the following vector: std::vector <void *> data; I have a function that checks for types to add data to the pointer as follows: As you can see, for each column we have a void * added to the vector. for(int c = 0; c != numCols; c++){ // ... case BOOL_TYPE: { bool *b; data.push_back((void *) b);

Setting up Mysql++ in linux

六眼飞鱼酱① 提交于 2019-12-03 07:35:14
I want to connect to a mysql database with C++ in linux. On my local machine I am running Ubuntu, and installed the mysql server and client packages: sudo apt-get install mysql-server mysql-client I came across Mysql++ but have some problems when running ./configure from their binary package. The error says: checking for MySQL library directory... configure: error: Didn't find mysqlclient library in '/usr/lib64 /usr/lib /usr/lib64/mysql /usr/lib/mysql /usr/local/lib64 /usr/local/lib /usr/local/lib/mysql /usr/local/mysql/lib /usr/local/mysql/lib/mysql /usr/mysql/lib/mysql /opt/mysql/lib /opt

About MySQL++, GPL and LGPL [closed]

纵然是瞬间 提交于 2019-12-01 05:34:15
问题 Closed. This question is off-topic. It is not currently accepting answers. Want to improve this question? Update the question so it's on-topic for Stack Overflow. Closed 4 years ago . MySQL++ is licensed though LGPL, that means that I could release an executable dynamically linked against it without worrying about the source code not being GPL. But, MySQL++ DOES link against libmysqlclient{_r}.{a,so} ( http://tangentsoft.net/mysql++/#linkerrors ) which is GPLed. As seen as then MySQL++ is

Why simple mysql++ code compiles standalone, but not in project?

浪尽此生 提交于 2019-11-29 18:29:45
At first, small program: #include <mysql++.h> using namespace mysqlpp; void mainuu () { Connection conn("mysql", "localhost", "root", "pwd");} If I compile it as one file in CodeLite or in such way: g++ -I/usr/include/mysql -I/usr/include/mysql++ -lmysqlclient -lmysqlpp -o Test mysql_api.cpp it's ok but, when I try to build whole project with this file I get this: g++ -o ./Debug/server ./Debug/main.o ./Debug/log.o ./Debug/packet.o ./Debug/mysql_api.o -L. ./Debug/mysql_api.o: In function `mainuu()': /home/asyler/.codelite/workspace/test/server/mysql_api.cpp:10: undefined reference to `mysqlpp:

Why simple mysql++ code compiles standalone, but not in project?

独自空忆成欢 提交于 2019-11-28 12:28:24
问题 At first, small program: #include <mysql++.h> using namespace mysqlpp; void mainuu () { Connection conn("mysql", "localhost", "root", "pwd");} If I compile it as one file in CodeLite or in such way: g++ -I/usr/include/mysql -I/usr/include/mysql++ -lmysqlclient -lmysqlpp -o Test mysql_api.cpp it's ok but, when I try to build whole project with this file I get this: g++ -o ./Debug/server ./Debug/main.o ./Debug/log.o ./Debug/packet.o ./Debug/mysql_api.o -L. ./Debug/mysql_api.o: In function