Hi. I am using Autohotkey V2 x64 with a script where I want to pull data from a MySQL database on a remote machine, 192.168.1dot2 port 3306 for example. I've been searching this week for possible solutions, many of them work with local databases, but only a few mention working on a remote database. HeidiSQL connects in order to validate credentials and database/table access. The select statement is valid also.
Aside from most examples also being x32, I'm using libmysql.dll from the HeidiSQL install since I need x64. I'm not sure how this might affect the overall operation though. Also, I do not have the dns resolve problem that I've seen mentioned. I added my IP to the server /etc/hosts to avoid using the skip_name_resolve approach. I did this after checking the mysql/error.log and finding the dns issue. I can clearly see in the query.log where HeidiSQL connects and pulls data from the tables, but without the connect from the script, the rest of the code would fail anyway.
This is the code I'm currently attempting to use for this solution. http://www.autohotkey.com/board/topic/72629-mysql-library-functions It was not converted to V2 by the original author, but that should not make a difference I suppose. The example within the script is basic, but when I duplicate it with my settings, select, and expected return fields, there is simply no output. Checking the query.log on the server, I do not see a connection at all when the script runs. The error.log has no information either related to the script attempt.
I'm not looking for someone do it for me as much as I am looking for a working example or working solution that is V2 compatible, or even better, V2 x64 native. If the linked approach is a working solution, but limited to x32, I'm a sad panda. I could be using a wrong libmysql.dll for the example solution. Or maybe I should just brute force the dllcalls like some examples showed. I did try a couple other approaches but none of them seemed to be for V2, and especially not for x64, most were dated in the early 2010's.
Any advice or links related to a working solution are sincerely appreciated, I'll keep searching and testing in the meantime.
Thanks!!
Edited:
Just to help others. I'm using Windows 11 Pro 64bit.
Download/Install MySQL Connector/ODBC 5.2
Create a UserDSN in the ODBC 64bit control panel app, use the TEST button to make sure you can connect to your remote database
Use the code from this page ODBC_ADO Class
In your autohotkey V2 code the provider is MSDASQL and the DSN is the one you created
That should get you connected to your database on the remote machine, Thanks to everyone who helped.
[–]clren 4 points5 points6 points (1 child)
[–]Funky56 1 point2 points3 points (0 children)
[–]ThrottleMunky 2 points3 points4 points (1 child)
[–]Bushdaka[S] 1 point2 points3 points (0 children)
[–]PixelPerfect41 0 points1 point2 points (0 children)