I have the following settings:
datadir = /var/db/mysql/data
innodb_data_home_dir = /var/db/mysql/innodb
innodb_file_per_table = ON
My intention is to store the innodb data in /var/db/mysql/innodb
but it is still being stored under /var/db/mysql/data/database_name/
. I would expect that my settings would achieve my desired behavior as per https://mariadb.com/kb/en/innodb-file-per-table-tablespaces/ which reads:
"By default, InnoDB's file-per-table tablespaces are created in the system's data directory, which is defined by the datadir system variable. If you want to store InnoDB data separate from the data for other storage engines, then you change this by setting the the innodb_data_home_dir system variable."
It doesn't work for me though. Any ideas? Thanks!
Server version: 10.5.13-MariaDB-log
There are no errors in the log related to this "issue".
mysql_install_db -u mysql
after changing these settings to create the layout. The directories need to be created before runningmysql_install_db
.mysql_install_db
after changing the innodb_file_per_table setting. I only did a fewALTER TABLE tbl_name ENGINE=InnoDB
to convert tables from myisam to innodb.innodb_file_per_table
is ok aftermysql_install_db
. What exactly does 'didn't work for me' mean?innodb_data_home_dir
for me containsibtmp1
,ib_buffer_pool
andibdata1
.ALTER TABLE
in my test. Happy to see bug reports for better documentation and ifALTER TABLE
doesn't work for you (look atshow warnings
afterwards).