Practical MySQL Tablespace and Partitioning - Part 2: Resizing the InnoDB System Tablespace
Part 2 focuses on operational procedures for resizing the InnoDB system tablespace.
The system tablespace is not something we should change casually. The safest approach is to validate current configuration, use controlled shutdown behavior, and verify results after restart.
Pre-Change Checks
Start with current state verification.
systemctl status mysqld
cat /etc/my.cnf
SHOW GLOBAL VARIABLES LIKE 'innodb_data%';
SHOW VARIABLES LIKE 'innodb_autoextend_increment';
SHOW GLOBAL VARIABLES LIKE 'innodb_fast_shutdown';
Why Set innodb_fast_shutdown=0
Before structural storage changes, use a slow shutdown so InnoDB can fully flush and merge internal state.
SET GLOBAL innodb_fast_shutdown = 0;
SHOW GLOBAL VARIABLES LIKE 'innodb_fast_shutdown';
Expected result should show value 0.
Option A: Grow with Autoextend
If your last data file in innodb_data_file_path includes autoextend, InnoDB can grow automatically in increments.
Configuration pattern:
innodb-data-file-path=ibdata1:12M:autoextend
Increment control:
SHOW VARIABLES LIKE 'innodb_autoextend_increment';
Option B: Add a New Data File
When you want explicit file layout expansion:
- Stop MySQL.
- Update
innodb-data-file-pathin/etc/my.cnf. - Ensure
autoextendis only on the last data file. - Start MySQL.
- Validate variables and files.
Example configuration:
innodb-data-home-dir=/var/lib/mysql/innodb/
innodb-data-file-path=ibdata1:12M;ibdata2:12M:autoextend
Post-Change Validation
systemctl status mysqld
ls -lrth /var/lib/mysql/innodb
SHOW GLOBAL VARIABLES LIKE 'innodb_data%';
SHOW VARIABLES LIKE 'innodb_autoextend_increment';
You should confirm that the new file path and home directory values match configuration.
Operational Notes
- Keep one clear rollback plan before editing storage paths.
- Avoid mixing multiple storage changes in one restart window.
- Document old and new layouts for future troubleshooting.
In Part 3, I cover moving UNDO tablespaces and resizing temporary tablespace safely.