perl5-dbi / DBD-mysql

MySQL driver for the Perl5 Database Interface (DBI)
https://metacpan.org/module/DBD::mysql
Other
63 stars 73 forks source link

DBD::mysql - mysql.xs.dll not found (Strawberry) #318

Closed rtillian closed 1 week ago

rtillian commented 5 years ago

Connecting with my $dbh = DBI->connect( "DBI:mysql:$dbname:host=$hostname","$username", "$password", ..... results in install_driver(mysql) failed: Can't load 'c:/Strawberry/perl/vendor/lib/auto/DBD/mysql/mysql.xs.dll' for module DBD::mysql: load_file: The module not found at c:/Strawberry/perl/lib/DynaLoader.pm line 193.

Solution suggested in some places is: Copying C:\strawberry\c\bin\libmysql.dll_ to c:\strawberry\perl\vendor\lib\auto\mysql does not work in Release Strawberry 5.28.2. - This does not work.

My unusual solution was to copy libmysql_.dll from ActiveState 5.12 (yes, but I was in despair) to c:\strawberry\perl\vendor\lib\auto\mysql - But I think fixing this within the distribution (or Strawberry) should be better.

dveeden commented 5 years ago

I think this should be fixed in Strawberry. If there are things which can be done in the distribution please let me know. I'm not familiar with Perl on Windows.

LeeThompson commented 3 years ago

Having this problem on Windows 2008 R2 with Strawberry Perl strawberry-perl-5.30.3.1-64bit In my case, copying the libmysql.dll from/strawberry/c/bin worked.

What I don't get is /strawberry/c/bin is in the path.

NOTE: You can also make symlinks instead. (mklink libmysql.dll /strawberry/c/bin/libmysql.dll)

rtillian commented 3 years ago

Lee, thank you very much!

pjcs00 commented 2 years ago

I am also getting this error: Windows 11, Strawberry Perl 5.32.1.1. The problem is not that the file is missing: it is in the location specified in the error message, ie c:/Strawberry/perl/vendor/lib/auto/DBD/mysql/mysql.xs.dll . I have tried both 32 and 64 bit Strawberry Perl - both give the same error.

hfga commented 2 years ago

Mr. LeeThompson's solution worked for me.

For future reference, libmysql.dll should be copied to "C:/Strawberry/perl/vendor/lib/auto/DBD/mysql/" or to the same folder mysql.xs.dll, if you installed strawberry perl in a location other then the one selected by default.

alexandre1 commented 1 year ago

Hi I was attempting to download mysql-connector-c-6.1.11.zip but could not find any place. I need the mysql.xs.dll

dveeden commented 1 year ago

Hi I was attempting to download mysql-connector-c-6.1.11.zip but could not find any place. I need the mysql.xs.dll

This should be available on https://downloads.mysql.com/archives/c-c/

genio commented 1 year ago

Strawberry ships with DBD::mysql and the mysql library. You shouldn't need to do anything. I suspect there's something else going on

genio commented 1 year ago

@LeeThompson The reasoning on the PATH can be found here: https://github.com/StrawberryPerl/Perl-Dist-Strawberry/issues/11#issuecomment-674433024

dveeden commented 1 week ago

Closing this as this seems to be a issue with StrawberryPerl (which is likely already fixed) and not an issue with DBD::mysql.

If it is not fixed and needs changes in DBD::mysql then please post more details and we can re-open it.