Configure the independent tablespace of MySQL Innodb to configure the database as an independent tablespace: 1. see [SQL] <span style = "font-size: 14px;"> <span style = "font-family: SimSun; "> mysql> show variables like '% per_table % '; + rows + ------- + | Variable_name | Value | + ----------------------- + ------- + | innodb_file_per_table | OFF | + --------------------- + ------- + 1 row in set (0.00 sec) </span> Note: OFF indicates that mysql is a shared tablespace, that is, data of all databases is stored in an ibdate1 file r. Directory structure database directory for installing mysql in pm:/var/lib/mysql/configuration file:/usr/share/mysql (mysql. server commands and configuration files) related commands:/usr/bin (mysqladmin, mysqldump, and other commands) (* a secure mysql startup method: /usr/bin/mysqld_safe -- user = root &) Startup Script:/etc/rc. d/init. d/2. stop the mysql server: [SQL] <span style = "font-size: 14px;"> <span style = "font-family: SimSun; "> mysql [root @ localhost ~] installed in rpm Mode #/Etc/rc. d/init. d/mysqld stop </span> [SQL] <span style = "font-size: 14px;"> <span style = "font-family: SimSun; "> [root @ localhost ~] #/Etc/init. d/mysqld stop </span> 3. modify my. cnf file: In my. the cnf file mysqld is followed by the following sentence: Because rpm is installed, it cannot be found. Copy my-* from the mysql configuration file directory -*. change the cnf file to the etc directory and change it to my. cnf [SQL] <span style = "font-size: 14px;"> <span style = "font-family: SimSun; "> innodb-file-per-table = 1 </span> 4. start mysql [SQL] <span style = "font-size: 14px;"> <span style = "font-family: SimSun;"> [root @ localhost ~] # Service mysql start or [root @ localhost ~] #/Etc/init. d/mysqld start </span> 5. check [SQL] <span style = "font-size: 14px;"> <span style = "font-family: SimSun; "> mysql> show variables like '% per_table % '; + rows + ------- + | Variable_name | Value | + ----------------------- + ------- + | innodb_file_per_table | ON | + --------------------- + ------- + 1 row in set (0.00 sec) </span> conclusion: the standalone and shared tablespaces of mysql innodb use the data and Put the table files together. The shared tablespace stores the data of all databases in the ibdate1 file. The Internet says that you delete the data and it will not contract. That is to say, if you delete the table data if the file is 40 GB, this file is still 40 GB, which is terrible, so we replace it with an independent tablespace. In addition, although independent, I personally think it is not very thorough. I copied those files to another database, only tables and no data, so it is not thorough!