Re: MySQL/MariaDB DBD install problem
by dasgar (Priest) on Sep 16, 2024 at 21:05 UTC
|
Did a little bit of investigation of documentation. Although DBD::mysql::INSTALL makes a claim that Strawberry Perl comes with DBD::mysql, DBD::MariaDB::INSTALL does not make a similar claim about DBD::MariaDB.
After doing some digging around on Strawberry Perl's releases page, it looks like version 5.36.1.1 does include DBD::mysql, but it was dropped starting with the next released version (5.36.3.1). Unless you really need be on version 5.40, you should be able to download Strawberry Perl 5.36.1.1 to interact with MySQL. (If you want to do a quick test without installing another version of Strawberry Perl, you can download the portable edition.) Otherwise, the install links above might be good starting points on trying to troubleshoot your install efforts for those two modules.
| [reply] |
|
|
For what it's worth cygwin currently comes with Perl 5.40.0, DBI 1.644, and DBD::mysql 4.052, and cpanm DBD::MariaDB works from a cygwin terminal.
$ cpanm DBD::MariaDB
--> Working on DBD::MariaDB
Fetching http://www.cpan.org/authors/id/P/PA/PALI/DBD-MariaDB-1.23.tar
+.gz ... OK
Configuring DBD-MariaDB-1.23 ... OK
Building and testing DBD-MariaDB-1.23 ... OK
Successfully installed DBD-MariaDB-1.23
1 distribution installed
| [reply] [d/l] [select] |
Re: MySQL/MariaDB DBD install problem
by syphilis (Archbishop) on Sep 17, 2024 at 01:29 UTC
|
I have tried to install the module using CPAN and I get the message that the installer cannot find "mysql.h".
Simplest way to ensure that the unlocatable "mysql.h: is found is to:
set CPATH=C:\Ampss\mysql\include;%CPATH%
prior to running cpan.
You might also need to set the LIBRARY_PATH environment variable to locate the mysql library (.a) files.
I'm assuming this mysql library that you have is compatible with strawberry's gcc-13.2.0 compiler.
You might also get good help by filing an issue about this at https://github.com/StrawberryPerl/Perl-Dist-Strawberry/issues.
Cheers, Rob
| [reply] [d/l] |
|
|
| [reply] |
|
|
| [reply] |
|
|
|
|
To install DBD-Maria-1.22 onto latest StrawberryPerl-5.40.0, I copied over the libmysql stuff from StrawberryPerl-5.38.2 (portable edition).
That is:
1) copy mysql_config.bat from SP-5.38.2/c/bin to SP-5.40.0/c/bin;
2) copy libmysql__.dll from SP-5.38.2/c/bin to SP-5.40.0/c/bin;
3) copy libmysql.a from SP-5.38.2/c/lib to SP-5.40.0/c/lib;
4) copy the mysql50716 folder from SP-5.38.2/c/include to SP-5.40.0/c/include;
Then I built and installed the module manually from downloaded source (by running perl Makefile.PL, then gmake test, then gmake install).
You could also install version 1.22 using either the cpan or cpanm utilities - but you have to direct it to grab the 1.22 source.
Version 1.23 won't build against that library because the symbol __imp___pioinfo can't be resolved.
If you can substitute in a (presumably more recent) mysql library that resolves that symbol, then you should be able to install version 1.23.
Cheers,
Rob
| [reply] [d/l] [select] |
|
|
Re: MySQL/MariaDB DBD install problem
by Danny (Chaplain) on Sep 16, 2024 at 16:53 UTC
|
I would first double check that the @INC variable contains the correct paths and then double check that mysql.pm is not in them with something like:
perl -wE 'for my $d (@INC) { -s "$d/DBD/mysql.pm" and say "$d/DBD/mysq
+l.pm" }'
If it's not present I would go back to the original installation and figure out why they weren't installed. If they are supposed to be there but are not, then something may be wrong with your installation in general.
Also probably worth looking at perl -V | grep version to make sure you are using the perl you think you are using. | [reply] [d/l] [select] |
|
|
| [reply] |
|
|
This is an example where I think a better idiom for telling people to run commands isn't to give them a shell-prompt starting point, but a Perl one, so here:
$ perl -wE 'for my $d (@INC) { -s "$d/DBD/mysql.pm" and say "$d/DBD/my
+sql.pm" }'
would become:
C:\strawberry>perl -de 0
Loading DB routines from perl5db.pl version 1.57
Editor support available.
Enter h or 'h h' for help, or 'perldoc perldebug' for more help.
main::(-e:1): 0
[errors from Term::ReadKey to be ignored]
DB<1> for my $d (@INC) { -s "$d/DBD/mysql.pm" and say "$d/DBD/mysql.
+pm" }
C:/strawberry/perl/vendor/lib/DBD/mysql.pm
That would then be immune to the vagaries of Windows command lines. | [reply] [d/l] [select] |
|
|
| [reply] [d/l] [select] |
Re: MySQL/MariaDB DBD install problem
by Marshall (Canon) on Sep 16, 2024 at 16:41 UTC
|
Please show your code for connecting to the DB. Should be something like this for mysql:
use strict;
use warnings;
use DBI;
$dbh = DBI->connect('DBI:mysql:databasename', 'username', 'password'
) || die "Could not connect to database: $DBI::errstr";
| [reply] [d/l] |
|
|
My code is pretty much identical to the code you posted. I get the message that either "mysql" is spelled wrong or the capitalization is incorrect or the DBD::mysql module is not installed. Checking the installed modules with instmodsh.bat, it shows the DBD::mysql module is not installed. When I attempt to install the module using CPAN, I see the error that the makefile.pl does not find the file "mysql.h".
| [reply] |