Custum datadir is being ignored after a upgrade

all of these instruction were followed and working for years

I just did an upgrade from Ubuntu 20.04 to 22.04 and now mysql keeps using the default datadir

any idea’s what has changed the config files all seem to be pointing where I wanted them to ?

Server version: 5.7.29-32 Percona Server
Ubuntu 22.04

/etc/apparmor.d/usr.sbin.mysqld

/etc/apparmor.d/tunables/alias

/etc/mysql/mysql.conf.d/mysqld.cnf

/etc/mysql/my.cnf

are all still pointing to my datadir

mysql config files

mysqlstrace.txt (369.6 KB)

1 Like

Run the following to see if mysql is actually picking up your settings:

# mysqld --print-defaults

If you don’t see --datadir= in the output, then mysql is not picking up your config files. Check # update-alternatives --query my.cnf to see if the OS changed anything.

1 Like

thanks for participating , unfortunately I get empty results

aio@aio:~$ mysqld --print-defaults
mysqld would have been started with the following arguments:

aio@aio:~$

aio@aio:~$ update-alternatives --query my.cnf
Name: my.cnf
Link: /etc/mysql/my.cnf
Status: auto
Best: /etc/mysql/mariadb.cnf
Value: /etc/mysql/mariadb.cnf

Alternative: /etc/mysql/mariadb.cnf
Priority: 500

Alternative: /etc/mysql/my.cnf.fallback
Priority: 100

Alternative: /etc/mysql/percona-server.cnf
Priority: 300
aio@aio:~$

and everyone of those files has the datadir set to a custom path that is being ignored

1 Like

Hi!

Check if /etc/my.cnf file exists and/or any other !include directive that might be trying to include another cnf file that overrides existing paths

1 Like

well their was not a
/etc/my.cnf file
so I created one and now its working