[CLASS] MySQLAPI - MySQL wrapper

Post your working scripts, libraries and tools for AHK v1.1 and older
needle
Posts: 5
Joined: 18 Apr 2018, 07:20

Re: [CLASS] MySQLAPI - MySQL wrapper

18 Apr 2018, 07:31

just me wrote: The project was cancelled, and currently I havn't time as well as interest to continue the work on the class script. It might be useful anyway, that's why it's here:
Hello everybody,
I need to connect a script I wrote to a MariaDB and I'd like to know if these are the latest and most complete SQL libs or there have been further developments: all the info I'm finding is several years old.
Thanks a lot!
Elendiar
Posts: 17
Joined: 03 Jul 2018, 05:44

Re: [CLASS] MySQLAPI - MySQL wrapper

17 Aug 2018, 08:00

Hi, thanks you for usefull scripts, but i have and issue.
Try connect to server, reject with message:
Connection failed!
2026 - SSL connection error: Unable get certificate

Connection from HeiduSQL successfull, connect to another server through lib successfull too. How can i disable ssl or connect and ignore this ? I have no access to sql server, nead read data. What can it be ?
kyuuuri
Posts: 340
Joined: 09 Jan 2016, 19:20

Re: [CLASS] MySQLAPI - MySQL wrapper

27 Nov 2018, 09:40

Hello, i have a problem with libmysql.dll

I get this error when running MySQLAPI_demo.ahk:
"could not load" (path to libmysql.dll / it is the same folder as the demo.ahk) ... "is not a valid win32 app".
I already downloaded all x32 versions from here https://downloads.mysql.com/archives/c-c/ and none of those work, even tried the x64 ones and i get the same error.

Any help is appreciated, thank you.
kyuuuri
Posts: 340
Joined: 09 Jan 2016, 19:20

Re: [CLASS] MySQLAPI - MySQL wrapper

27 Nov 2018, 10:12

kyuuuri wrote:
27 Nov 2018, 09:40
Hello, i have a problem with libmysql.dll

I get this error when running MySQLAPI_demo.ahk:
"could not load" (path to libmysql.dll / it is the same folder as the demo.ahk) ... "is not a valid win32 app".
I already downloaded all x32 versions from here https://downloads.mysql.com/archives/c-c/ and none of those work, even tried the x64 ones and i get the same error.

Any help is appreciated, thank you.
I solved it, i feel stupid, i was running the .ahk with ahk 64 bits hahaha. You have to run it with x32.
iaveto
Posts: 1
Joined: 04 Jan 2019, 09:40

Re: [CLASS] MySQLAPI - MySQL wrapper

04 Jan 2019, 09:51

Hi just me!

I tried to connect to my database using your class but got a message box with this:

Query:
(here is my query)

Result:
Name =
Value =

What should I do?
just me
Posts: 9763
Joined: 02 Oct 2013, 08:51
Location: Germany

Re: [CLASS] MySQLAPI - MySQL wrapper

05 Jan 2019, 03:11

iaveto wrote:What should I do?
At least you should post your code. I'm not a MySQL expert, but others here might be able to answer your question.
cdkdang
Posts: 2
Joined: 18 Mar 2019, 00:53

Re: [CLASS] MySQLAPI - MySQL wrapper

19 Mar 2019, 00:48

Can someone tell me what the array format of Fetch_Row() is?

Normally i use print_r in php to find out but apparently there's no equivalent for ahk.

thanks
just me
Posts: 9763
Joined: 02 Oct 2013, 08:51
Location: Germany

Re: [CLASS] MySQLAPI - MySQL wrapper

19 Mar 2019, 04:33

:arrow: MYSQL_ROW

Excerpt from the class code:

Code: Select all

   ; ===================================================================================================================
   ; Returns the values of the next row of the given MYSQL_RES as an array.
   ; Parameters:    MYSQL_RES - Pointer to a MYSQL_RES structure.
   ; Return values: Array of values, False if there is no more row
   ; ===================================================================================================================
   GetNextRow(MYSQL_RES) {
      If (MYSQL_ROW := This.Fetch_Row(MYSQL_RES)) {
         Row := []
         Lengths := This.Fetch_Lengths(MYSQL_RES)
         Loop, % This.Num_Fields(MYSQL_RES) {
            J := A_Index - 1
            If (Len := NumGet(Lengths + 0, 4 * J, "UInt"))
               Row[A_Index] := (StrGet(NumGet(MYSQL_ROW + 0, A_PtrSize * J, "UPtr"), Len, "UTF-8"))
            Else
               Row[A_Index] := ""
         }
         Return Row
      }
      Return False
   }
cdkdang
Posts: 2
Joined: 18 Mar 2019, 00:53

Re: [CLASS] MySQLAPI - MySQL wrapper

16 Apr 2019, 01:41

Just a reminder to myself and anyone else who are having the "Could not find [path]\libmysql.dll"

Just downloading the dll and having it in the script path is not enough.

The operating system actually has to have the appropriate libmysqlclient installed.

Once that is installed, having a correct copy of the libmysql.dll in the script path is sufficient.

Maybe change the error message from "could not find" to "could not load", as the first message indicates a location issue.

Probably self evident to anyone with half a brain, but I wasted days on finding and downloading various libmysql.dll and putting them into various folders (script folder, modules folder, system32, root, etc).
Klarion
Posts: 176
Joined: 26 Mar 2019, 10:02

Re: [CLASS] MySQLAPI - MySQL wrapper

16 Apr 2019, 20:04

@cdkdang
nice
User avatar
manehscripts
Posts: 126
Joined: 03 May 2019, 16:10

Re: [CLASS] MySQLAPI - MySQL wrapper

03 May 2019, 16:16

Hello, the program works perfectly but I wanted to know how do I enable the connection of any IP? In order to make it work, I had to register my IP on the DB Server. I need to release access to everyone who needs to use the program. Thanks!

Solved: I just gave the permission with (%) on my server to everyone.
-----------------------------------------------------------
Stop to think, shut up to resist, and act to win!
hot hot 85
Posts: 18
Joined: 27 Dec 2015, 19:34

Re: [CLASS] MySQLAPI - MySQL wrapper

09 Aug 2019, 15:52

I was looking in the library for command to close the connection but I , didn't find it , some one knows how can i do it?
just me
Posts: 9763
Joined: 02 Oct 2013, 08:51
Location: Germany

Re: [CLASS] MySQLAPI - MySQL wrapper

10 Aug 2019, 05:38

There's a Close() method called internally when the DB object is destroyed (e.g. MyDB := ""). External calls might need some additional actions on the DB object.
chelste1824
Posts: 2
Joined: 15 Jan 2019, 18:18

Re: [CLASS] MySQLAPI - MySQL wrapper

07 Nov 2019, 12:12

I want all the stored mac back in the database but I can't find how to do it, I can't find the necessary function, example GetNextRow, help me, plz

SQL= select macpc from registro
+--------------+
| macpc |
+--------------+
| xxxxxxxxxxxx |
| yyyyyyyyyyyyyy |
| zzzzzzzzzzzzzz |
+--------------+

example.

resp:=Result(SQL)

Msgbox % resp

---------------------------------------
;Print
xxxxxxxxxxxx
yyyyyyyyyyyyyy
zzzzzzzzzzzzzz
william_ahk
Posts: 639
Joined: 03 Dec 2018, 20:02

Re: [CLASS] MySQLAPI - MySQL wrapper

02 Jan 2022, 04:56

DBGVIEWCLEAR[ERROR] SSL error: Unable to get certificate from ''.
I'm also having this issue with the latest dll of MySQL 8.0. Oddly the AHK DBA library works.
Skywalker
Posts: 12
Joined: 14 Oct 2013, 15:28

Re: [CLASS] MySQLAPI - MySQL wrapper

25 Jan 2022, 07:06

Hi Wiliam,
i also try at the moment to connect with SSL to MySQL
With Heidi everthing works fine, but i cannot get a connection with AHK and DBA

Do you have a hint for me ?
Thank you so much in advance!
william_ahk
Posts: 639
Joined: 03 Dec 2018, 20:02

Re: [CLASS] MySQLAPI - MySQL wrapper

09 Feb 2022, 07:00

@Skywalker It seems there's something incompatible with MySQL 8.0 in this API class. I switched back to MySQL 5.7 at the moment.
Chutriel
Posts: 3
Joined: 15 Sep 2017, 09:23

Re: [CLASS] MySQLAPI - MySQL wrapper

25 Nov 2023, 04:28

Hi,

same here. Have to stay on 5.7, I am using this class in a very big application, and I love it for its simplicity. Is there anyone, that had any success in using it with MySQL 8 ?
just me
Posts: 9763
Joined: 02 Oct 2013, 08:51
Location: Germany

Re: [CLASS] MySQLAPI - MySQL wrapper

26 Nov 2023, 09:52

Hi,

which errors do you get when you try to use MySQL v8?
User avatar
Jovannb
Posts: 268
Joined: 17 Jun 2014, 02:44
Location: Austria

Re: [CLASS] MySQLAPI - MySQL wrapper .. former libmysql.dll from 2017 stopped working with Win10 22H2 64-bit

14 Mar 2024, 11:19

Hi,

I learned to know, that until this month, the 32-bit libmysql.dll from 2017 worked problem-free with Win10 22H2 64 bit together with AHK1.1.xx A32 on more than 15 computers.
But beginning with this month, with a new computer (Dell 9440) and Win10 22H2 64-bit, driver wont work, I got a message, that the library (libmysql.dll) cant be found, despite it was there and accessible for my .ahk-scripts.

After a longer investigation period, with procmon (sysinternals, russinovich) and not getting any satisfying result, we (a fellow and me) found, that there is a newer 32-bit libmysql.dll from 2022 - you can find it in 32-bit release of www.heidisql.com.
With that newer libmysql.dll everything works smoothly as previously with all my clients which use AHK 1.1.xx A32.

Hopefully somebody else can use that information which costs me more than 10 hours.
JB.
AHK: 1.1.37.01 Ansi, 32-Bit; Win10 22H2 64 bit, german

Return to “Scripts and Functions (v1)”

Who is online

Users browsing this forum: submeg and 130 guests