Re: Help on how to compile/install module DBD::MariaDB/Mysql on Windows using Strawberry Perl
by choroba (Cardinal) on Jul 22, 2025 at 15:11 UTC
|
Instead of using a relative path like .\mariadb_config.pl, try using the full path (e.g. c:\System\Roaming\Secret Folder\Apps\mariadb_config.pl). Also, if the path contains spaces, quoting might be needed.
map{substr$_->[0],$_->[1]||0,1}[\*||{},3],[[]],[ref qr-1,-,-1],[{}],[sub{}^*ARGV,3]
| [reply] [d/l] [select] |
|
Changing the call to "--mariadb_config="C:\Program Files\MariaDB 11.8\bin\mariadb_config.pl"
I get the same kind of error : "Specified mysql configuration script 'C:\PROGRA~1\MariaDB 11.8\bin\mariadb_config.pl' doesn't exist.
Please check path/permissions."
Now that I have put the mariadb_config.pl into the 'C:\PROGRA~1\MariaDB 11.8\bin', which is on the path, I have ran the Makefile.pl without the "--mariadb_config" option, and it finds the script by itself. I have, then, another error :
"Checking if libs and header files are available for compiling...
Can't link/include C library 'windows.h', 'winsock.h', 'mysql.h', 'mysqlclient', aborting."
However it finds the parameters from the mariadb_config.pl script :
cflags (User's choice) = -IC:\Program Files\MariaDB 11.8\inc
+lude\mysql
libs (User's choice) = -LC:\Program Files\MariaDB 11.8\lib
+ -lmysqlclient
requireembsup (default ) = 0
testauthplugin (default ) =
testdb (User's choice) = test
testembdatadir (default ) =
testemboptions (default ) =
testhost (default ) =
testpassword (default ) =
testport (default ) =
testsocket (default ) =
testuser (User's choice) = perl
mysql.h is found in directory C:\Program Files\MariaDB 11.8\include\mysql, but not the other 3 required files. I don't where they can be...
| [reply] [d/l] |
|
Thanks Choroba,
I have tried the full path, it doesn't work.
I have also tried with double quotes, with just the name mariadb_config.pl without the directory "./" but it doesn't work. I have learned that the file must be in the PATH. On Windows, the current directory is always in the PATH. So I don't understand. Next step : I can replace the original script which is in the path and does not work with mine which works well.
Best,
| [reply] |
Re: Help on how to compile/install module DBD::MariaDB/Mysql on Windows using Strawberry Perl
by pryrt (Abbot) on Jul 23, 2025 at 22:34 UTC
|
You didn't say which version of Strawberry Perl you installed. But since you implied it was installed recently, I am going to assume 5.40.
Your post Re^2: Help on how to compile/install module DBD::MariaDB/Mysql on Windows using Strawberry Perl was at 20:46 UTC, whereas there was a comment on the the SO post at 18:51 UTC, saying to look at syphilis's Re^3: MySQL/MariaDB DBD install problem here. Did you try that? Since you never commented in either location that you'd tried that, I am assuming not. So despite the fact that I don't have MariaDB server installed, I tried following those instructions.
Specifically, I looked at syphilis's post, and used that as the basis for the following steps, which I ran, with the results as described:
- Download and install the MariaDB C Connectors at https://mariadb.com/downloads/connectors/ to get the header files in the right spot
-- I don't know if that's a required step if you've already got MariaDB server installed
-- For me, it installed some libraries into c:\Program Files\MariaDB\MariaDB Connector C 64-bit\lib\ and some headers into c:\Program Files\MariaDB\MariaDB Connector C 64-bit\include\, so if the server didn't install anything into those directories, you might need to separately install the C Connectors.
- Since Strawberry Perl 5.40 doesn't come with the mysql_config.bat or some of the associated libraries, but syphilis pointed out in the other conversation that Strawberry Perl 5.38 does, I downloaded the zipfile for StrawberryPerl 5.38 Portable edition.
- Per syphilis's instructions, copy the 4 files from the specific directories in the 5.38 zipfile into your main StrawberryPerl 5.40 installation. That's easy to do by opening the zipfile in one Windows Explorer window, and your c:\strawberry\ (or wherever you installed 5.40) in a second Windows Explorer window -- obviously putting each file into the correct directory relative to that main directory, as per the instructions.
- At the command line, where your installed StrawberryPerl 5.40 is available, run cpanm DBD::MariaDB
-- For me, it tried to install v1.24 of the module, but I got the same undefined reference to `__imp___pioinfo' as was mentioned for v1.23 in the other discussion.
-- Thus, I tried to force the earlier v1.22 instead, using cpanm DBD::MariaDB@1.22 : this command was able to install DBD::MariaDB for me, in my Strawberry Perl 5.40. SUCCESS.
Again, I don't know if having MariaDB server already installed will eliminate the first step or not. And you probably don't need to waste your time with the first cpanm DBD::MariaDB , and should probably go straight to cpanm DBD::MariaDB@1.22 . But this worked to get it installed for me (obviously, whether it will work with a server is something I cannot test). But if you haven't tried this sequence yet, you probably should.
| [reply] [d/l] [select] |
Re: Help on how to compile/install module DBD::MariaDB/Mysql on Windows using Strawberry Perl
by ysth (Canon) on Jul 22, 2025 at 17:58 UTC
|
Are you trying to do local development of something that is in production, in Perl? Or writing Perl as part of your job, or just using Perl as a tool to help you do your job? Does your job require you to work in windows or just have it installed on your work system? The more that you can tell us, the better we can suggest things to help.
mysql 5.7 is not stable, it is well past end of life and no longer receiving security updates, so should be considered unsafe. You really should not use it unless you have to to mimic a production environment that is still using it.
That said, show more exactly what you did to try to install DBD::mysql and what errors resulted. Maybe an older version would work?
Not sure what role the database plays in your job; if you are using the MariaDB client, why not use the server too? Note that MySQL and MariaDB are not fully compatible anymore; each has added different features since the fork, or implemented new features in different, incompatible ways, though if you stick to things supported in MySQL 5.5, you won't see many issues.
Other alternatives: run perl under WSL 2, or a VM, or cygwin? Any of those can make building modules easier. | [reply] |
|
Sorry, perhaps it was not very explicit. Let me explain : I have more than one computer (including Macs, Raspberry PI...) but for historical reasons, I develop using Perl on a Windows PC. I mainly use MySQL and Perl to process databases requests, manipulating text files and converting data between two formats, for processing data between different softwares. For many years, I worked on this PC with MAMP and Active Perl, without any issue. MySQL 5.7 was very satisfying for my purpose. Everything was doing fine until I uninstalled Active Perl and installed Strawberry Perl, mainly because I had to reinstall some missing modules from CPAN.
Due to the difficulties I had to install DBD::mysql modules, I tried MariaDB to check if it was working better, because more recent. I don't care to use MySQL or MariaDB. For me, this is the same. I don't need some particularities of the one or the second. And yes, I use a server in addition of the client. In fact, the mysql client or mariadb client is not very useful for me (but perhaps for the driver itself). I mainly use the server with my Perl scripts and with also a lot of PHPMyAdmin. But due to the emergency of this situation for me, I'm looking for other solutions that MySQL and MariaDB, which works pretty the same way, with Perl. But for years everything was very easy with the use of the mysql driver for DBI. I don't understand these sudden difficulties. I read here and elsewhere that I should downgrade the driver to an older version (v4x). Frankly, for my needs, I would be glad to use a binary distribution of the driver, like I had with Active Perl and PPM. It was working without any issue and was easy to install new modules.
Unfortunately, I don't have much time to experiment different kind of installations, because I have already tried different things for the last 24 hours, including all yesterday's night. And now I need to go forward with my work, without spending extra time to try to "debug" the whole installation.
I'll try to install Cygwin when I have so more time to play. Thanks for your help.
Best.
Sorry for the signature misplaced. I fixed it.
| [reply] |
Re: Help on how to compile/install module DBD::MariaDB/Mysql on Windows using Strawberry Perl
by choroba (Cardinal) on Jul 22, 2025 at 18:36 UTC
|
Crossposted to StackOverflow. It's considered polite to inform about crossposting so that people not attending both sites don't waste time hacking on a problem already solved at the other end of the internet.
map{substr$_->[0],$_->[1]||0,1}[\*||{},3],[[]],[ref qr-1,-,-1],[{}],[sub{}^*ARGV,3]
| [reply] [d/l] |
|
Sorry, but the issue is not solved. I will inform you here if I can find a solution.
| [reply] |