MySQL Innodb independent tablespace Configuration

Source: Internet
Author: User

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!

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.