Tuesday, April 19, 2022

Check data file location and tablespaces in MariaDB or MySQL

Check data file location and tablespaces in MariaDB or MySQL


Check size and location of data files or tablespaces present in MySQL or MariaDB

Check innodb_file_per_table parameter.

innodb_file_per_table=ON, InnoDB uses one tablespace file per table.

innodb_file_per_table=OFF, InnoDB stores all tables in the InnoDB system tablespace.

show variables like 'innodb_file_per_table'


Check the location of datafile/tablespace present in MySQL or MariaDB:

-- On MySQL

show variables like 'datadir';


Variable_name|Value                        

-------------+------------------------+

datadir      |/var/lib/mysql/|


Check files and tablespace for MySQL:

select * from information_schema.FILES;


Check files and tablespace detail for MariaDB:

select * from information_schema.innodb_sys_tablespaces; 

No comments:

Post a Comment