Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Installation problems with DBD::mysql on Widows server 2022 #454

Closed
geekdad1 opened this issue Dec 16, 2024 · 6 comments · Fixed by #456
Closed

Installation problems with DBD::mysql on Widows server 2022 #454

geekdad1 opened this issue Dec 16, 2024 · 6 comments · Fixed by #456
Assignees

Comments

@geekdad1
Copy link

DBD::mysql version

5.010

MySQL client version

No response

Server version

Windows server 2022

Operating system version

Server 2022

What happened?

Please remove all references to using short filenames. they seem to be no longer supported under windows server 2022 and they haven't been a thing since windows 3.1 went away.

Other information

No response

@dveeden
Copy link
Collaborator

dveeden commented Dec 16, 2024

The only reference I can find is this:

$opt->{'mysql_config'} = Win32::GetShortPathName($opt->{'mysql_config'})

@dveeden
Copy link
Collaborator

dveeden commented Dec 16, 2024

There is a fsutil 8dot3name utility that can help to see if short names are enabled on the system and on the volume:
https://learn.microsoft.com/en-us/windows-server/administration/windows-commands/fsutil-8dot3name

The docs of Win32 ( https://metacpan.org/pod/Win32#Win32::GetShortPathName(PATHNAME) ) say that the short (8.3) components are only used when available and that otherwise full length paths are used.

The available options are:

  • Win32::GetLongPathName(PATHNAME)
  • Win32::GetShortPathName(PATHNAME)
  • Win32::GetFullPathName(FILENAME)
  • Win32::GetANSIPathName(FILENAME)

There is also this note: https://metacpan.org/pod/Win32#Short-Path-Names

So DBD::mysql now uses GetShortPathName(), which returns an relative path with short components where available. A logical alternative would be GetLongPathName() which also gives relative paths, but with with longname components.

GetFullPathName() gives an absolute path instead of a relative one.

GetANSIPathName() gives a relative path that may use the shortname if the longname does not have a representation on the system codepage.

The docs seem to suggest that GetANSIPathName() is the right option if you want to pass the result along.

Small test:

use v5.20;
use Win32;

print("short: " . Win32::GetShortPathName("Users\\danie\\Documents\\test.pl") . "\n");
print("long: " . Win32::GetLongPathName("Users\\danie\\Documents\\test.pl") . "\n");
print("full: " . Win32::GetFullPathName("Users\\danie\\Documents\\test.pl") . "\n");
print("ansi: " . Win32::GetANSIPathName("Users\\danie\\Documents\\test.pl") . "\n");

Result:

C:\>perl Users\danie\Documents\test.pl
short: Users\danie\DOCUME~1\test.pl
long: Users\danie\Documents\test.pl
full: C:\Users\danie\Documents\test.pl
ansi: Users\danie\Documents\test.pl

C:\>

@dveeden
Copy link
Collaborator

dveeden commented Dec 16, 2024

Some more info on my system:

C:\>fsutil 8dot3name query c:
The volume state is: 0 (8dot3 name creation is enabled).
The registry state is: 2 (Per volume setting - the default).

Based on the above settings, 8dot3 name creation is enabled on c:

C:\>chcp
Active code page: 850

C:\>ver

Microsoft Windows [Version 10.0.19045.5131]

C:\>

@dveeden
Copy link
Collaborator

dveeden commented Dec 16, 2024

@geekdad1 does #456 look ok to you? Is this what you meant?

@geekdad1
Copy link
Author

geekdad1 commented Dec 17, 2024 via email

@dveeden
Copy link
Collaborator

dveeden commented Dec 17, 2024

Note that these happen both with and without #456:

"\x{0159}" does not map to cp850 at C:/Strawberry/perl/lib/ExtUtils/MakeMaker.pm line 1271.
"\x{0159}" does not map to cp850 at C:/Strawberry/perl/lib/ExtUtils/MakeMaker.pm line 1271.
"\x{0159}" does not map to cp850 at C:/Strawberry/perl/lib/ExtUtils/MakeMaker.pm line 1271.

This is probably because various files contain a ë that is part of my name.

I can confirm that #456 improves things a bit (perl Makefile.PL ... output):

Before:

  mysql_config  (Users choice ) = c:\STRAWB~1\c\bin\MYSQL_~1.BAT

After:

  mysql_config  (Users choice ) = c:\Strawberry\c\bin\mysql_config.bat

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants