Innodb independent tablespace configuration, innodb independent table
Innodb independent tablespace Configuration
Environment Introduction:
MySQL version: 5.5.40
1. Check whether the independent tablespace is enabled.
Mysql> show variables like '% per_table % ';
+ ----------------------- + ------- +
| Variable_name | Value |
+ ----------------------- + ------- +
| Innodb_file_per_table | OFF |
+ ----------------------- + ------- +
1 row in set (0.00 sec)
Note: OFF indicates that mysql is a shared tablespace.
2. Stop the mysql server:
[Root @ localhost ~] #/Etc/init. d/mysqld stop
3. Modify the my. cnf file:
[Mysqld]
Innodb-file-per-table = 1
4. Start mysql
[Root @ localhost ~] #/Etc/init. d/mysqld start
5. Check whether the function is enabled
Mysql> show variables like '% per_table % ';
+ ----------------------- + ------- +
| Variable_name | Value |
+ ----------------------- + ------- +
| Innodb_file_per_table | ON |
+ ----------------------- + ------- +
1 row in set (0.00 sec)
Summary:
1. If the online server needs to save data, add two more steps.
A. Use mysqldump to back up data
B. use mysql to restore the corresponding data
Reference: http://blog.csdn.net/jacson_bai/article/details/44781033
2. When deleting the old file, you must delete both ibdata * and the corresponding log file ib_logfile *. Otherwise, an exception will be prompted when you start MySQL. the mysql. pid file is missing;