WxWidgets 3.1, Windows, codeblocks and MySQL Topic is solved

In this forum you can discuss database related issues which can be wxWidgets related, but also generic in nature.
Post Reply
marcusbarnet
Experienced Solver
Experienced Solver
Posts: 71
Joined: Sat Jul 27, 2019 3:45 pm

WxWidgets 3.1, Windows, codeblocks and MySQL

Post by marcusbarnet »

Hi to all,

I'm having lot of problems in finding a way to connect to a MySQl database by using WxWdigets on Windows.

On Linux, I use mysql++ library and everything works fine, but I can't figure out how to do it under Windows.
I don't need to use exactly the same library, I just need to be able to run queries like SELECT and INSERT in order to manipulate data.

I already installed phpmyadmin, MySQL under Windows and they work fine.

I've found some posts in this forum about Wxsqlite3 and wxdatabase, but they are all too old compared to my version and they doesn't work.
marcusbarnet
Experienced Solver
Experienced Solver
Posts: 71
Joined: Sat Jul 27, 2019 3:45 pm

Re: WxWidgets 3.1, Windows, codeblocks and MySQL

Post by marcusbarnet »

I'm still looking on google, but it's very hard to find a good document/tutorial.
User avatar
doublemax
Moderator
Moderator
Posts: 19102
Joined: Fri Apr 21, 2006 8:03 pm
Location: $FCE2

Re: WxWidgets 3.1, Windows, codeblocks and MySQL

Post by doublemax »

Do you need to connect to an existing MySQL DB or do you just need any SQL database embedded in your application? In the latter case wxSQLite3 is probably the best option. It doesn't use MySQL though.

Otherwise, check wxDatabase. https://github.com/mtangoo/wxDatabase
Its last commit is from November 2019, so i'd expect it to run with the latest wxWidgets version.
Use the source, Luke!
marcusbarnet
Experienced Solver
Experienced Solver
Posts: 71
Joined: Sat Jul 27, 2019 3:45 pm

Re: WxWidgets 3.1, Windows, codeblocks and MySQL

Post by marcusbarnet »

I'm creating the database from scratch so I can choose the architecture. I usually use Mysql with phpmyadmin but it's ok to use any other solution.

I checked wxSQLite3 but I wasnt able to use it correctly.

Is there any tutorial that can explain me how to install and use the wxdatabase?
User avatar
doublemax
Moderator
Moderator
Posts: 19102
Joined: Fri Apr 21, 2006 8:03 pm
Location: $FCE2

Re: WxWidgets 3.1, Windows, codeblocks and MySQL

Post by doublemax »

I'm creating the database from scratch so I can choose the architecture. I usually use Mysql with phpmyadmin but it's ok to use any other solution.
In that case i highly recommend wxSQLite3. It's well documented and its author (utelle) is regularly here on this forum.
https://github.com/utelle/wxsqlite3
Is there any tutorial that can explain me how to install and use the wxdatabase?
Sorry, i've never used it myself.
Use the source, Luke!
marcusbarnet
Experienced Solver
Experienced Solver
Posts: 71
Joined: Sat Jul 27, 2019 3:45 pm

Re: WxWidgets 3.1, Windows, codeblocks and MySQL

Post by marcusbarnet »

I will try to check again wxsqlite3 and how to install it on windows. I see that it uses databases in .db format: I never used it so I do not know how to populate the tables, is there an utility like phpmyadmin to manage the database?
User avatar
doublemax
Moderator
Moderator
Posts: 19102
Joined: Fri Apr 21, 2006 8:03 pm
Location: $FCE2

Re: WxWidgets 3.1, Windows, codeblocks and MySQL

Post by doublemax »

marcusbarnet wrote: Sun Feb 16, 2020 9:59 pm I will try to check again wxsqlite3 and how to install it on windows. I see that it uses databases in .db format: I never used it so I do not know how to populate the tables, is there an utility like phpmyadmin to manage the database?
https://sqlitebrowser.org/
Use the source, Luke!
utelle
Moderator
Moderator
Posts: 1125
Joined: Tue Jul 05, 2005 10:00 pm
Location: Cologne, Germany
Contact:

Re: WxWidgets 3.1, Windows, codeblocks and MySQL

Post by utelle »

marcusbarnet wrote: Sun Feb 16, 2020 9:59 pm I'm creating the database from scratch so I can choose the architecture. I usually use Mysql with phpmyadmin but it's ok to use any other solution.
Which database architecture should be chosen heavily depends on the needs of your application. If a central database is required for all users of your application, choose a client-server database like MySQL. If an embedded database is all what your application needs, choose SQLite3 (and optionally wxSQLite3 for accessing it from your wxWidgets application).
marcusbarnet wrote: Sun Feb 16, 2020 9:59 pm I checked wxSQLite3 but I wasnt able to use it correctly.
If you have difficulties in using wxSQLite3, then ask here on the forum or on GitHub.
marcusbarnet wrote: Sun Feb 16, 2020 9:59 pm I will try to check again wxsqlite3 and how to install it on windows.
wxSQLite3 provides build files for VC++ and gcc/Mingw64 under Windows.
marcusbarnet wrote: Sun Feb 16, 2020 9:59 pm I see that it uses databases in .db format: I never used it so I do not know how to populate the tables, is there an utility like phpmyadmin to manage the database?
SQLite databases usually consist of a single database file, which can be named with any file extension. That is, .db does not mean dBase file format. wxSQLite3 provides a precompiled SQLite3 command line shell. If you prefer a GUI tool for database administration, use SQliteBrowser or SQLite Studio.
YuMERA
Knows some wx things
Knows some wx things
Posts: 44
Joined: Fri Jul 05, 2019 8:47 pm

Re: WxWidgets 3.1, Windows, codeblocks and MySQL

Post by YuMERA »

marcusbarnet wrote: Sun Feb 16, 2020 7:26 pm Hi to all,

I'm having lot of problems in finding a way to connect to a MySQl database by using WxWdigets on Windows.

On Linux, I use mysql++ library and everything works fine, but I can't figure out how to do it under Windows.
I don't need to use exactly the same library, I just need to be able to run queries like SELECT and INSERT in order to manipulate data.

I already installed phpmyadmin, MySQL under Windows and they work fine.

I've found some posts in this forum about Wxsqlite3 and wxdatabase, but they are all too old compared to my version and they doesn't work.
https://youtu.be/3v_lA1Gg1Q4

https://youtu.be/siQCWPxDtMo
marcusbarnet
Experienced Solver
Experienced Solver
Posts: 71
Joined: Sat Jul 27, 2019 3:45 pm

Re: WxWidgets 3.1, Windows, codeblocks and MySQL

Post by marcusbarnet »

Very useful!

Honestly, I was going to use SQLite3 even if I didn't like to have an embedded database, but the MySQL integration on Windows seemed to hard for me.

Thanks to that Youtube video, I was able to successfully integrate it in my code, so now I'm using it without problems!
Post Reply