[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: Custom mariadb installation



Hello,

On Fri, Feb 26, 2021 at 10:44:27AM -0800, Bill wrote:
> So I'd like to install mariadb on Debian 10 with the
> --basedir=/usr/local/mariadb and --datadir=/data/mariadb. I've tried to add
> these options to the "apt install mariadb-server" command line but I get
> error messages saying the options aren't recognized.

Those are options for the mariadb program itself. You can put them
in configuration files, overriding what is already set, e.g.:

$ sudo ack datadir /etc/mysql/
/etc/mysql/mariadb.conf.d/50-server.cnf
21:datadir                 = /var/lib/mysql

So I would suggest making your own custom config file in
/etc/mysql/mariadb.conf.d/ numbered after 50 and override it there:

[mysqld]
basedir = /usr/local/mariadb
datadir = /data/mariadb

Do bear in mind that the installation of mariadb will create some
databases in the default location first as part of its setup. You
may want to pre-create your config files (which the install won't
overwrite) so that it gets the correct settings at first startup and
during the initial configuration.

Also mariadb doesn't have an AppArmor profile at the moment but it
could grow one, so you'd have to watch out for that as it's very
likley to restrict the daemon to only being able to access
/var/lib/mysql.

Cheers,
Andy


Reply to: