Details
-
Bug
-
Status: Closed (View Workflow)
-
Critical
-
Resolution: Fixed
-
10.3.3
-
10.1.32
Description
a default compiled mariadb (CMAKE_INSTALL_PREFIX:PATH=/usr/local/mysql) installed, with make install.
path set:
$ export PATH=$PATH:/usr/local/mysql/bin:/usr/local/mysql/scripts
|
|
$ mysql_install_db --defaults-file=~/my.cnf --datadir=~/data2
|
|
FATAL ERROR: Could not find ./bin/my_print_defaults
|
A work around is to include `--basedir=/usr/local/mysql` in the mysql_install_db options however this should be default on an install.
Recently changed in all versions (though problem probably existed before hand).
https://github.com/MariaDB/server/commit/52516706c86f9f66c76836eabde7e2477694bac3
Attachments
Issue Links
- duplicates
-
MDEV-14617 mysql_install: if no basedir set, use CMAKE_INSTALL_PREFIX as basedir
-
- Closed
-
I think it could've been fixed simpler, by not resetting $basedir:
diff --git a/scripts/mysql_install_db.sh b/scripts/mysql_install_db.sh
--- a/scripts/mysql_install_db.sh
+++ b/scripts/mysql_install_db.sh
@@ -251,8 +251,11 @@ then
cannot_find_file my_print_defaults $basedir/bin $basedir/extra
exit 1
fi
-else
+elif test -x "@bindir@/my_print_defaults"
print_defaults="@bindir@/my_print_defaults"
+else
+then
+ basedir="@CMAKE_INSTALL_PREFIX@"
+ print_defaults="@CMAKE_INSTALL_PREFIX@/@bindir@/my_print_defaults"
fi
But should it default to /usr/loca//mysql? tarball is supposed to be fully relocatable, it can be unpacked anywhere. I don't know if it's safe to assume that it'll be unpacked into /usr/local/mysql.