Solved Mariadb not in system path on clean install almalinux 9 LXC template

yonatanp

Verified User
Joined
Aug 25, 2006
Messages
110
Location
Israel
after installing almalinux minimal on an LXC container , then installing directadmin,
the system completed installation with no errors ( other than missing openssh-server as i am using the pct interface to attach to the root, i disable it from the services list dont need it.)

but for some reason the mariadb was not added to the system path,
tried to re-install ,it did install ,but still no mariadb or mysqldump commands on root.

Bash:
local]# pwd;ls -lad maria*
/usr/local
drwxr-xr-x 11 root root 18 Jul 10 12:41 mariadb-10.6.18-199O
drwxr-xr-x 11 root root 18 Jul 10 11:24 mariadb-10.6.18-2Lek


I do 90% of my work on the command line,
i was able to create new databases from DA ,
but i wanted to import a 1GB database file, so i had to do it manually to prevent issues ( slow upload / timeout ).

i have just added the mariadb-10.6.18-2Lek bin folder to the path and now it works.

Question:
Is this normal ?
do i need to manually add to the random path that's created on install ?

or am i missing something or unaware of any issue that may rise with LXC alma9 and DA ?
 
used this template for the LXC: download.proxmox.com/images/system/almalinux-9-default_20221108_amd64.tar.xz

manually installed net-tools and run yum update.

tried again to install directadmin on a different server.

Code:
[root@directadmin ~]# mysqldump ; mariadb
bash: mysqldump: command not found
bash: mariadb: command not found
[root@directadmin ~]# ls -lad /usr/local/mar*
drwxr-xr-x 11 root root 4096 Jul 11 05:15 /usr/local/mariadb-10.6.18-ZQn4
[root@directadmin ~]#

do we need to add it manually to the path from now on?
 
@yonatanp it would be best to open a support ticket, so we could investigate it further. The general idea how CustomBuild installs MariaDB is:
  • Extract files to /usr/local/mariadb-{version}-{rand}.
  • Replace symlink /usr/local/mysql to point to the latest /usr/local/mariadb-{version}-{rand}.
  • For each CLI tool/binary in the /usr/local/mysql/bin directory create a symlink to it in the /usr/local/bin directory.
Example on how it would look on a fresh install:

Code:
# ls -la /usr/local/
...
drwxr-xr-x 12 root     root     4096 May 28 14:34 mariadb-10.11.8-USVV
lrwxrwxrwx  1 root     root       20 May 28 14:34 mysql -> mariadb-10.11.8-USVV
...

# which mariadb
/usr/local/bin/mariadb

# ls -la /usr/local/bin/mariadb
lrwxrwxrwx 1 mysql mysql 28 Jan  6  2023 /usr/local/bin/mariadb -> /usr/local/mysql/bin/mariadb

# ls -la /usr/local/mysql/bin/mariadb
-rwxr-xr-x 1 root root 8989360 May 11 00:33 /usr/local/mysql/bin/mariadb

To debug it I would start by checking if:
  • You have /usr/local/bin in the PATH environment variable
  • Symlink /usr/local/bin/mariadb exists and points to /usr/local/mysql/bin/mariadb
  • Symlilnk /usr/local/mysql exists and points to /usr/local/mariadb-{version}-{rand}
 
@fin thank you so much, this helped confirm my assumption.
Im using legacy not asking for support for what i can fix.
wish i could update mariadb to 10.11 to test with different versions.


I can confirm local is not in the default $PATH on this template.
So for this LXC template,
we have to manually add a $PATH right after the setup.sh is completed because the correct $PATH to local does not exists.
on this setup it was replaced by $USER .local

Bash:
[root@directadmin ~]# echo $PATH;ls -la /usr/local/bin/mariadb;ls -la /usr/local/mysql

/root/.local/bin:/root/bin:/sbin:/bin:/usr/sbin:/usr/bin

lrwxrwxrwx 1 root root 28 Jul 11 05:15 /usr/local/bin/mariadb -> /usr/local/mysql/bin/mariadb

lrwxrwxrwx 1 root root 20 Jul 11 05:15 /usr/local/mysql -> mariadb-10.6.18-ZQn4
 
Last edited:
Back
Top