Project

General

Profile

Do Wt:DBO supports MYSQL

Added by Naveen A.N over 11 years ago

Hello,

I was not able to find support of MYSQL in wt:DBo.

If it has support can u please redirect to some tutorial.


Replies (9)

RE: Do Wt:DBO supports MYSQL - Added by Koen Deforche over 11 years ago

Hey,

There is a MySQL backend that is used in exactly the same way as the other backends.

http://www.webtoolkit.eu/wt/doc/reference/html/classWt_1_1Dbo_1_1backend_1_1MySQL.html

Just replace Sqlite3 with MySQL and modify the constructor arguments to pass the relevant information for setting up a MySQL connection.

Regards,

koen

RE: Do Wt:DBO supports MYSQL - Added by Naveen A.N over 11 years ago

Hello Koen,

I can see the Sqlite3 but if i use MySQL it gives me compilation error.

Do i need to add any flag while installing ?

Naveen.A.N

RE: Do Wt:DBO supports MYSQL - Added by Koen Deforche over 11 years ago

Hey,

You also need to include the correct header files. What is the exact error you get?

Regards,

koen

RE: Do Wt:DBO supports MYSQL - Added by Naveen A.N over 11 years ago

Hello Koen,

This is how i imported.

#include <Wt/Dbo/backend/MySQL>

And i just declared it like Wt::Dbo::backend::MySQL mysql and it gives the issue

ERROR:

../src/test.h:25:32: warning: Wt/Dbo/backend/MySQL: No such file or directory
../src/test.cpp: In member function 'void Test::List(int, char**)':
../src/test.cpp:23: error: 'MySQL' is not a member of 'Wt::Dbo::backend'
../src/test.cpp:23: error: expected `;' before 'mysql'
make: *** [src/test.o] Error 1

Naveen.A.N

RE: Do Wt:DBO supports MYSQL - Added by Koen Deforche over 11 years ago

Hey,

What version of Wt do you use? The MySQL backend is only available since version 3.3.0

Regards,

koen

RE: Do Wt:DBO supports MYSQL - Added by Naveen A.N over 11 years ago

I am not sure can u please tell me how can i check the version?

RE: Do Wt:DBO supports MYSQL - Added by Steven Descheemaeker over 11 years ago

Hello,

the fix to your problem:

install:

sudo apt-get install libmysqlclient-dev

and cmake with:

cmake .. -DMYSQL_LIBRARY=mysqlclient

RE: Do Wt:DBO supports MYSQL - Added by Naveen A.N over 11 years ago

Hello Steven ,

Thanks for the information,But i am using Mac.

Naveen.A.N

RE: Do Wt:DBO supports MYSQL - Added by Steven Descheemaeker over 11 years ago

I had the same problem on ubuntu, I guess you are missing the mysq-library. This thread handles about the problem:

http://redmine.webtoolkit.eu/boards/2/topics/6770

kind regards

Steven

    (1-9/9)