I've had similar issues getting MariaDB up and running.
My system is Archlinux Linux 6.7.4-arch1-1
and MariaDB v10.5 but I built from source. Having read over the "Post-Install" scripts I wanted to make sure that everything was setup as intended by the devs.
Specifically in, scripts/mariadb-install-db
, which is typically invoked as root mariadb-install-db --user=mysql --basedir=/usr --datadir=/var/lib/mysql
but if you're building from source (i.e. decompressing some binary or compiling) running the mariadb-install-db
command will need the either --basedir
or --srcdir
not both.
For me, I ended up running sudo mariadb-install-db --srcdir=. --datadir=/var/lib/mysql
. Since I compiled from source I had to direct the install script to all the toolings and binaries.
For what its worth if going this route you will need to update your PATH
as well.
I can see you're running a Windows based system but the above should be easily adjusted to for the difference.
# Create database directories
for dir in "$ldata"
do
if test ! -d "$dir"
then
if ! `mkdir -p "$dir"`
then
echo "Fatal error Can't create database directory '$dir'"
link_to_help
exit 1
fi
chmod 700 "$dir"
fi
if test -n "$user"
then
if test -z "$group"
then
chown $user $dir
else
chown $user:$group $dir
fi
if test $? -ne 0
then
echo "Cannot change ownership of the database directories to the '$user'"
echo "user. Check that you have the necessary permissions and try again."
exit 1
fi
fi
done
Where $dir
is --datadir
and $user
$group
are mysql
. You want to make sure that this directory is created and set with 0700
permissions (owner rwx
is 0700
).
With this setup you can then run the daemon. If you are still having issues there are steps to double-check from the INSTALL-BINARY
file:
41 │ The basic commands that you must execute to install and use a
42 │ MariaDB binary distribution are:
43 │
44 │ shell> groupadd mysql
45 │ shell> useradd -g mysql mysql
46 │ shell> cd /usr/local
47 │ shell> gunzip < /path/to/mariadb-VERSION-OS.tar.gz | tar xvf -
48 │ shell> ln -s full-path-to-mariadb-VERSION-OS mysql
49 │ shell> cd mysql
50 │ shell> chown -R mysql .
51 │ shell> chgrp -R mysql .
52 │ shell> scripts/mysql_install_db --user=mysql
53 │ shell> chown -R root .
54 │ shell> chown -R mysql data
55 │ shell> bin/mysqld_safe --user=mysql &
There are very detailed instructions written up in the source
Hope this helps!