Can't connect to MySQL anymore

Just starting out? Need help? Post your questions and find answers here.
User avatar
Jac de Lad
Enthusiast
Enthusiast
Posts: 106
Joined: Wed Jul 15, 2020 7:10 am
Contact:

Can't connect to MySQL anymore

Post by Jac de Lad »

The following code worked fine on 5.72, but not on 5.73:

Code: Select all

UseMySQLDatabase("Mydtive:\Myfolder\libmariadb.dll")
database=OpenDatabase(#PB_Any,"host=myhost port=3306 dbname=mydb","user","password",#PB_Database_MySQL)

Now it produces a "UseODBCDatabase(), UseSQLiteDatabase() bzw. UsePostgreDatabase() muss vor dem Verwenden von Datenbank-Befehlen aufgerufen werden."

Not a single word about MySQL...

It works with 5.73 Beta 3.
User avatar
mk-soft
Always Here
Always Here
Posts: 5335
Joined: Fri May 12, 2006 6:51 pm
Location: Germany

Re: Can't connect to MySQL anymore

Post by mk-soft »

No problem here ... PB v5.72 LTS Win 7
My Projects ThreadToGUI / OOP-BaseClass / EventDesigner V3
PB v3.30 / v5.75 - OS Mac Mini OSX 10.xx - VM Window Pro / Linux Ubuntu
Downloads on my Webspace / OneDrive
Marc56us
Addict
Addict
Posts: 1477
Joined: Sat Feb 08, 2014 3:26 pm

Re: Can't connect to MySQL anymore

Post by Marc56us »

This message is displayed when the path is incomplete or the DLL is not a compatible version.
First of all: if external resources are used, always test their presence before use so as not to leave the end user with no way to identify an error.

Code: Select all

DB_DLL$ = "C:\Program Files\PureBasic\Compilers\libmariadb.dll"

If FileSize(DB_DLL$) <= 0
    MessageRequester("Error", "DLL not present")
    End
EndIf

UseMySQLDatabase(DB_DLL$)

; ...
Then, is your DLL the version provided with PB 573 (not beta) ? libmariadb.dll 3.1.9
User avatar
jacdelad
Addict
Addict
Posts: 1432
Joined: Wed Feb 03, 2021 12:46 pm
Location: Planet Riesa
Contact:

Re: Can't connect to MySQL anymore

Post by jacdelad »

Hello,
sorry for the late reply. I had problems with my account, for the hundredth time, because Google keeps deleting and moving the emails from here (and some others too). So I had to create a new account, which hopefully works now.

Yes, that helped. I always made sure the file is accessible, but obviously the version had changed and the older one was not usable. Updating the DLL worked.

Thanks!
PureBasic 6.04/XProfan X4a/Embarcadero RAD Studio 11/Perl 5.2/Python 3.10
Windows 11/Ryzen 5800X/32GB RAM/Radeon 7770 OC/3TB SSD/11TB HDD
Synology DS1821+/36GB RAM/130TB
Synology DS920+/20GB RAM/54TB
Synology DS916+ii/8GB RAM/12TB
Joris
Addict
Addict
Posts: 885
Joined: Fri Oct 16, 2009 10:12 am
Location: BE

Re: Can't connect to MySQL anymore

Post by Joris »

jacdelad wrote:... because Google keeps deleting and moving the emails from here (and some others too).
Seems like thre are more things that become deleted : jacdelad 106 posts now down to 1 post.
Yeah I know, but keep in mind ... Leonardo da Vinci was also an autodidact.
User avatar
jacdelad
Addict
Addict
Posts: 1432
Joined: Wed Feb 03, 2021 12:46 pm
Location: Planet Riesa
Contact:

Re: Can't connect to MySQL anymore

Post by jacdelad »

Well, not a big loss though.
PureBasic 6.04/XProfan X4a/Embarcadero RAD Studio 11/Perl 5.2/Python 3.10
Windows 11/Ryzen 5800X/32GB RAM/Radeon 7770 OC/3TB SSD/11TB HDD
Synology DS1821+/36GB RAM/130TB
Synology DS920+/20GB RAM/54TB
Synology DS916+ii/8GB RAM/12TB
Post Reply