PDA

View Full Version : Qt 5.7 mingw 5.3 windows mariadb 10.2



frankgigeur
23rd March 2018, 01:10
Hi everybody, it's been 10 hours i try and search around on the web what i should do to make it work but nothing. Like i wrote in the title , i wish to connect to my mariadb. Some people may say, why you don't use mysql or anything else? so the reason is my server use mariadb and it's my goal to connect my software to my online database


12796

12797

12799

12798



QSqlDatabase: QMYSQL driver not loaded
QSqlDatabase: available drivers: QSQLITE QMYSQL QMYSQL3 QODBC QODBC3 QPSQL QPSQL7
Database error occurred

I only need a clue where to start. I read so much docs, i really need a tips please.

Thanks a lot

high_flyer
23rd March 2018, 12:32
i wish to connect to my mariadb. Some people may say, why you don't use mysql or anything else? so the reason is my server use mariadb and it's my goal to connect my software to my online database

I don't understand.
You explicitly write you are not interested in using MySql, yet you configured your project to connect to MySql.
Why?

Also, this is not Qt question.
I don't know anything about mariadb, but my guess it that there is a library out there that offers API to access mariadb.
You need to link to that library, use its API to access your mariadb.
Forums that are dedicated to mariadb probably will be more helpful to you.

Also, don't post screenshots of your code, pose it in as text in code tags - this will make it easier for people who want to answer you with code based on your code.

d_stranz
23rd March 2018, 16:07
According to the MariaDB web site, MariaDB databases are supposed to be binary compatible with MySQL databases of the same version, so presumably a MySQL driver should be able to open and read them. The OP may need to install a MariaDB connector (https://mariadb.com/kb/en/library/mariadb-connector-c/) or a MySQL connector library. Like MySQL, it is not sufficient to have only the Qt-side driver, you also need the database-side driver that QMYSQL connects to.

Edit: BTW, you will probably have to build this connector from source code unless there is already a pre-built version for mingw 5.3. A version built using MS Visual Studio's compiler probably will not be compatible with a mingw executable.