# Permissions errors when trying to install mariadb using mariadb-install-db

**URL:** <https://forums.percona.com/t/permissions-errors-when-trying-to-install-mariadb-using-mariadb-install-db/41302>\
**Category:** MariaDB Server & Utilities\
**Created:** [October 2, 2026, 8:01am UTC](https://forums.percona.com/t/permissions-errors-when-trying-to-install-mariadb-using-mariadb-install-db/41302 "2026-10-02T08:01:49Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![xraphael75](https://avatars.discourse-cdn.com/v4/letter/x/76d3ee/32.png) [@xraphael75](https://forums.percona.com/u/xraphael75)\
**Post date:** [October 2, 2026, 8:01am UTC](https://forums.percona.com/t/permissions-errors-when-trying-to-install-mariadb-using-mariadb-install-db/41302/1 "2026-10-02T08:01:49Z")

</div>

I have kubuntu 26.04 and I’m trying to install 3 instances of mariadb using mariadb-install-db. I went through several tutorials, which are all slightly different:

- [https://medium.com/@omkarmanjrekar/running-multiple-mysql-instances-on-ubuntu-4af059aad5ae](https://medium.com/@omkarmanjrekar/running-multiple-mysql-instances-on-ubuntu-4af059aad5ae)
- [mariadbd-multi | Server | MariaDB Documentation](https://mariadb.com/docs/server/server-management/starting-and-stopping-mariadb/mariadbd-multi)
- [Ubuntu 22.04 Multi Mariadb install - HackMD](https://hackmd.io/@necdisd/HkXYj_IM2)
- [6.3.4&nbsp;mysqld\_multi — Manage Multiple MySQL Servers](https://docs.oracle.com/cd/E17952_01/mysql-8.0-en/mysqld-multi.html)
- [https://medium.com/@omkarmanjrekar/running-multiple-mysql-instances-on-ubuntu-4af059aad5ae](https://medium.com/@omkarmanjrekar/running-multiple-mysql-instances-on-ubuntu-4af059aad5ae)

I don’t want to install these instances on my main partition, as the file size could be hundreds of GB and my main drive/partition isn’t big enough. I have a 2TB drive/partition I want to put them on. These tutorials mostly recommend putting the instances in /var/run on the main partition, so I’m not sure if that could be part of the problem.

I created 2 folders on the 2TB drive:

```sql
/media/Crucial2TB/mariadb1/
/media/Crucial2TB/mariadb2/

```

I set both to 755 permissions and the owner and group to “mysql”

When I get to the step where I install/initialize the mariadb folders using mariadb-install-db I keep getting these permissions errors:

```sql
raphael@server1:/media/Crucial2TB/mariadb1$ sudo /usr/bin/mariadb-install-db --defaults-file=/etc/mysql/my_multi.cnf --datadir=/media/Crucial2TB/mariadb1/ --verbose --user=mysql
Installing MariaDB/MySQL system tables in '/media/Crucial2TB/mariadb1/' ...
2026-10-01 12:59:01 0 [Warning] Can't create test file '/media/Crucial2TB/mariadb1/linuxserver.lower-test' (Errcode: 13 "Permission denied")
/usr/sbin/mariadbd: Cannot change uid/gid (errno: 1)
2026-10-01 12:59:01 0 [ERROR] Aborting

Installation of system tables failed! Examine the logs in
/media/Crucial2TB/mariadb1/ for more information.

The problem could be conflicting information in an external
my.cnf files. You can ignore these by doing:

    shell> /usr/bin/mariadb-install-db --defaults-file=~/.my.cnf

You can also try to start the mariadbd daemon with:

    shell> /usr/sbin/mariadbd --skip-grant-tables --general-log &

and use the command line tool /usr/bin/mariadb
to connect to the mysql database and look at the grant tables:

    shell> /usr/bin/mariadb -u root mysql
    MariaDB> show tables;

Try '/usr/sbin/mariadbd --help' if you have problems with paths. Using
--general-log gives you a log in /media/Crucial2TB/mariadb1/ that may be helpful.

The latest information about mariadb-install-db is available at
https://mariadb.com/kb/en/installing-system-tables-mysql_install_db
You can find the latest source at https://downloads.mariadb.org and
the MariaDB discuss email list at https://lists.mariadb.org/postorius/lists/discuss.lists.mariadb.org/

Please check all of the above before submitting a bug report
at https://mariadb.org/jira

```

It says

```sql
Examine the logs in /media/Crucial2TB/mariadb1/ for more information.

```

but there are no files in that folder.

This is the config file in /etc/mysql/my\_multi.cnf (that I basically copied & pasted from the mariadb website [mariadbd-multi | Server | MariaDB Documentation](https://mariadb.com/docs/server/server-management/starting-and-stopping-mariadb/mariadbd-multi)):

```sql
[mysqld]
# This file should probably be in your home dir (~/.my.cnf)
       # or /etc/my.cnf
       # Version 2.1 by Jani Tolonen
       [mariadbd-multi]
       mariadbd = /usr/bin/mariadbd-safe
       mysqladmin = /usr/bin/mysqladmin
       user = multi_admin
       password = multipass
       [mariadbd1]
       socket = /tmp/mysql.sock1
       port = 3306
       pid-file = /media/Crucial2TB/mariadb1/server1.pid1
       datadir = /media/Crucial2TB/mariadb1
       language = /usr/local/share/mysql/english
       user = raphael
       tmpdir = /tmp
       [mariadbd2]
       socket = /tmp/mysql.sock2
       port = 3307
       pid-file = /media/Crucial2TB/mariadb2/server1.pid2
       datadir = /media/Crucial2TB/mariadb2
       language = /usr/local/share/mysql/english
       user = raphael

```

There are a lot of moving parts here and I don’t know where the issue is. Could it be the “–user” parameter? The user/group/permissions on the folders? The user in the my\_multi.cnf file? The user I’m running as? Missing files? Something else?

I also tried editing the /etc/mysql/mariadb.conf.d/50-server-multi.cnf file as mentioned in [Ubuntu 22.04 Multi Mariadb install - HackMD](https://hackmd.io/@necdisd/HkXYj_IM2) but I still got permissions errors.

I would have thought that running mariadb-install-db with sudo would have overridden any permissions issues, so the problem must be somewhere deeper in either Linux/Ubuntu or in the mariadb configs, but I don’t know where to look.

---

<div class="post-metadata">

**Author:** ![dogs\_Cute](https://sea1.discourse-cdn.com/flex019/user_avatar/forums.percona.com/dogs_cute/32/12754_2.png) [@dogs\_Cute](https://forums.percona.com/u/dogs_Cute)\
**Post date:** [October 4, 2026, 3:10am UTC](https://forums.percona.com/t/permissions-errors-when-trying-to-install-mariadb-using-mariadb-install-db/41302/2 "2026-10-04T03:10:37Z")

</div>

In fact, you have been misled. Actually, many codes of mariadbD-Multi of Maria DB point to mysql, so there will be problems when reading files. The simplest method is to manage each instance with an independent my.cnf

---

<div class="post-metadata">

**Author:** ![rachelwilson](https://avatars.discourse-cdn.com/v4/letter/r/8edcca/32.png) [@rachelwilson](https://forums.percona.com/u/rachelwilson)\
**Post date:** [October 5, 2026, 10:23am UTC](https://forums.percona.com/t/permissions-errors-when-trying-to-install-mariadb-using-mariadb-install-db/41302/3 "2026-10-05T10:23:33Z")

</div>

the giveaway is that sudo didn’t help. that usually means the block is below file permissions. check df -T on /media/Crucial2TB, if it is NTFS or exFAT then chown to mysql can never stick and a datadir there just won’t work, you’ll need ext4 or xfs. the other usual suspect on kubuntu is apparmor blocking mariadbd from writing outside /var/lib/mysql, so look for DENIED lines in dmesg after a failed run.

---

<div class="post-metadata">

**Author:** ![xraphael75](https://avatars.discourse-cdn.com/v4/letter/x/76d3ee/32.png) [@xraphael75](https://forums.percona.com/u/xraphael75)\
**Post date:** [October 5, 2026, 5:31pm UTC](https://forums.percona.com/t/permissions-errors-when-trying-to-install-mariadb-using-mariadb-install-db/41302/4 "2026-10-05T17:31:28Z")

</div>

I think you found the issue! I found this in the dmesg:

```auto
[352503.220064] audit: type=1400 audit(1791221384.185:15149): apparmor="DENIED" operation="mknod" class="file" profile="mariadbd" name="/media/Crucial2TB/mariadb1/server1.lower-test" pid=646292 comm="mariadbd" requested_mask="c" denied_mask="c" fsuid=0 ouid=0
[352503.221799] audit: type=1400 audit(1791221384.187:15150): apparmor="DENIED" operation="capable" class="cap" profile="mariadbd" pid=646292 comm="mariadbd" capability=6 capname="setgid"

```

Now I need to investigate how to workaround that.
