You are not logged in.

#1 2025-02-09 18:10:42

mrmonk
Member
Registered: 2023-10-01
Posts: 13

mariadb - Operation not permitted

I've installed mariadb. Upon running

mariadb-install-db --user=mysql --basedir=/usr --datadir=/var/lib/mysql

I get

> mariadb-install-db --user=mysql --basedir=/usr --datadir=/var/lib/mysql
chown: changing ownership of '/var/lib/mysql': Operation not permitted
Cannot change ownership of the database directories to the 'mysql'
user.  Check that you have the necessary permissions and try again.

I've tried running

sudo chown mysql:mysql /var/lib/mysql/

but its still failing.

Please let me know if I can provide any other information.
Thanks in advance.

Offline

#2 2025-02-09 19:11:00

loqs
Member
Registered: 2014-03-06
Posts: 18,877

Re: mariadb - Operation not permitted

> mariadb-install-db --user=mysql --basedir=/usr --datadir=/var/lib/mysql

Needs to be run with root privileges such as with `sudo`. On the MariaDB wiki page this is indicated by the # at the start of the command:

# mariadb-install-db --user=mysql --basedir=/usr --datadir=/var/lib/mysql

Offline

#3 2025-02-09 19:19:36

cryptearth
Member
Registered: 2024-02-03
Posts: 2,130

Re: mariadb - Operation not permitted

the install script should no longer be required - just start the server via systemctl start mariadb should do the trick
but what you still should run is the secure_installation script and set a root password (or switch access to unix socket)

Offline

Board footer

Powered by FluxBB