From 25b4b97c417c4cae71c116e7c082528223a91c89 Mon Sep 17 00:00:00 2001 From: Chris Miles Date: Mon, 6 Feb 2023 17:25:34 -0600 Subject: [PATCH] [DB Updates] Add Windows MySQL path auto detection for users where the path is not found (#2836) --- utils/scripts/eqemu_server.pl | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/utils/scripts/eqemu_server.pl b/utils/scripts/eqemu_server.pl index efdff15fa..633e5030c 100755 --- a/utils/scripts/eqemu_server.pl +++ b/utils/scripts/eqemu_server.pl @@ -1199,6 +1199,25 @@ sub get_mysql_path } } } + if ($path eq "") { + my @files; + my $start_dir = trim(`echo %programfiles%`); + find( + sub { + if ($#files > 0) { + return; + } + push @files, $File::Find::name unless $File::Find::name!~/mysql.exe/i; + }, + $start_dir + ); + for my $file (@files) { + if ($file=~/mysql.exe/i) { + $path = $file; + last; + } + } + } } if ($OS eq "Linux") { $path = `which mysql`;