Innodb獨立資料表空間的配置,innodb獨立表

來源:互聯網
上載者:User

Innodb獨立資料表空間的配置,innodb獨立表
Innodb獨立資料表空間的配置
環境介紹:
MySQL版本:5.5.40
1.查看獨立資料表空間是否開啟
mysql> show variables like '%per_table%';    
+-----------------------+-------+    
| Variable_name         | Value |    
+-----------------------+-------+    
| innodb_file_per_table | OFF   |    
+-----------------------+-------+    
1 row in set (0.00 sec) 
說明:OFF代表mysql是共用資料表空間
 
2.停止mysql伺服器: 

[root@localhost ~]#/etc/init.d/mysqld stop


3.修改my.cnf檔案:
[mysqld] 

innodb-file-per-table=1


4.啟動mysql   
[root@localhost ~]#/etc/init.d/mysqld start
 
5.驗證功能是否開啟
mysql> show variables like '%per_table%';    
+-----------------------+-------+    
| Variable_name         | Value |    
+-----------------------+-------+    
| innodb_file_per_table | ON   |    
+-----------------------+-------+    
1 row in set (0.00 sec)
總結:
1.如果線上伺服器需要儲存資料的,還要多加2步
 a.使用mysqldump備份資料
 b.使用mysql恢複對應資料
參考連結:http://blog.csdn.net/jacson_bai/article/details/44781033
2.刪除舊檔案時,既要刪除ibdata*,也要刪除相應log檔案ib_logfile*,否則啟動MySQL時,會提示異常缺少mysql.pid檔案;

相關文章

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.