MariaDB

Installation
Install the prerequisites:

yum install cmake ncurses-devel

Download the latest version, which was 10.11.9 at the time of writing.

cd /extra/src
wget https://mariadb.stl.us.ssimn.org/mariadb-10.11.9/source/mariadb-10.11.9.tar.gz
tar zxf mariadb-10.11.9.tar.gz
cd mariadb-10.11.9

Add a group and user for the mysql daemon. For a Linux system:

groupadd mysql
useradd -g mysql mysql

At this point, we don't need any advanced options, so our configuration options are simply - just the install path:

BUILD/autorun.sh
./configure --prefix=/usr/local/mysql

Make and install the binaries:

make
make install

Because we compiled and installed as root, we need to change the ownership on the installed files so that the mysql user can access them:

chown -R mysql /usr/local/mysql/

Create the MySQL data directory and initialize the user tables.

cd /usr/local/mysql
scripts/mysql_install_db --user=mysql

While most of the installation can be owned by root, the data directory must be owned by the mysql user:

chown -R root .
chown -R mysql data

Create a directory for the default log file and PID file:

mkdir /var/log/mariadb
chown mysql /var/log/mariadb
mkdir /var/run/mariadb
chown mysql /var/run/mariadb

To test out the installation, start up the MySQL server:

bin/mysqld_safe --user=mysql &

Post-Installation Setup
Secure the root and anonymous accounts:

cd bin
./mysql_secure_installation

Stop the MySQL daemon:

/usr/local/mysql/bin/mysqladmin shutdown

Automatic startup
We're going to use daemontools.
If you haven't already, install daemontools.

Create a directory for the MySQL service:

mkdir -m 1755 /var/service/mysql
cd /var/service/mysql

Create the /var/service/mysql/run script, making sure to change the servername:

#!/bin/sh
exec 2>&1
exec \
/usr/local/bin/setuidgid mysql \
/usr/local/mysql/bin/mysqld \
--old-passwords \
--basedir=/usr/local/mysql \
--datadir=/usr/local/mysql/data \
--user=mysql \
--pid-file=/usr/local/mysql/data/mariadb.pid \
--skip-external-locking \
--port=3306 \
--socket=/tmp/mysql.sock

Make the script executable:

chmod 755 run

Our log script comes from John Simpson's:

mkdir -m 755 log
cd log
wget http://qmail.jms1.net/scripts/service-any-log-run
mv service-any-log-run run
chmod 755 run

Finally, add the service to daemontools by creating the symbolic link in /service

ln -s /var/service/mysql /service/mysql

Confirm that the service is running:

svstat /service/mysql /service/mysql/log

Recent Updates

  • 1 month 23 hours ago
    1.27.2 update
  • 1 month 1 week ago
    Drupal 10/11 config
  • 1 month 1 week ago
  • PHP
    1 month 1 week ago
    PHP 8.3.11 and AlmaLinux
  • 1 month 1 week ago
    New version of Pound