Mysql InnoDB Plugin安装 install
轉(zhuǎn)載鏈接:http://www.orczhou.com/index.php/2010/03/innodb-plugin-setup/
InnoDB Plugin較之Built-in版本新增了很多特性:包括快速DDL、壓縮存儲(chǔ)等,而且引入了全新的文件格式Barracuda。眾多測(cè)試也表明,Plugin在很多方面優(yōu)于Built-in版本。當(dāng)前Plugin版本是1.0.6,一個(gè)RC版本。MySQL的官方版本中從5.1.42開(kāi)始也內(nèi)置了InnoDB Plugin1.0.6。
這里簡(jiǎn)單的介紹InnoDB Plugin的編譯安裝。
1. 下載源碼
這里使用MySQL5.1.45和InnoDB Plugin1.0.6版本安裝。需要單獨(dú)下載MySQL和InnoDB Plugin的源碼:MySQL Community Server 和 InnoDB Plugin
2. 解壓并替代源碼
我們需要使用下載的Plugin源碼代替MySQL源碼中的storage/innobase目錄。
tar zxvf mysql-5.1.45.tar.gz $tar zxvf innodb_plugin-1.0.6.tar.gz $rm -rf mysql-5.1.45/storage/innobase $mv innodb_plugin-1.0.6 mysql-5.1.45/storage/innobase
3. 編譯并安裝
$./configure --prefix=/opt/mysql --with-extra-charsets=all \ >--with-plugins=csv,innobase,myisam,heap $make && make install $cd /opt/mysql $./bin/mysql_install_db --basedir=/opt/mysql #初始化數(shù)據(jù)(權(quán)限表等) $vi /etc/my.cnf #初始化你的配置文件 $./bin/mysqld_safe & #啟動(dòng)數(shù)據(jù)庫(kù)這里需要注意的是,如果想使用InnoDB的Barracuda文件格式,需要在配置文件my.cnf新增:
loose_innodb_file_format=barracudaloose_innodb_strict_mode=1
4. 查看版本
安裝完成后,可以通過(guò)如下命令查看當(dāng)前版本:
root@(none) 10:49:15>select @@innodb_version; +------------------+ | @@innodb_version | +------------------+ | 1.0.6 | +------------------+ 1 row in set (0.00 sec) root@(none) 10:51:10>show plugins; ......5. 更多關(guān)于安裝
上面演示的是使用InnoDB Plugin源碼覆蓋MySQL源碼(./storage/innobase)的方式安裝。事實(shí)上,還可以使用MySQL5.1.45自帶的InnoDB Plugin代碼安裝,無(wú)需再單獨(dú)下載InnoDB Plugin源碼。這種安裝,會(huì)同時(shí)安裝兩個(gè)InnoDB版本:Built-in和Plugin,啟動(dòng)時(shí)需要特別注意。
5.1 直接解壓MySQL并編譯安裝
$./configure --prefix=/opt/mysql --with-extra-charsets=all \ > --with-plugins=csv,innobase,innodb_plugin,myisam,heap $make && make install $cd /opt/mysql $./bin/mysql_install_db --basedir=/opt/mysql #初始化數(shù)據(jù)(權(quán)限表等) $vi /etc/my.cnf #初始化你的配置文件(編譯參數(shù)中,with-plugins部分新增了innodb_plugin部分)
5.2 準(zhǔn)備加載InnoDB Plugin插件
這一步是比較復(fù)雜的,為了加載Plugin,需要先將built-in禁用。首先將配置配置文件中所有innodb相關(guān)的選擇注釋掉(也可以使用loose前綴);然后在配置文件中添加忽略InnoDB built-in的參數(shù):
ignore_builtin_innodb #忽略InnoDB built-in#注釋InnoDB選擇 #innodb_flush_method = O_DIRECT #innodb_file_per_table = 1 #innodb_flush_log_at_trx_commit = 2 #innodb_lock_wait_timeout = 100 ...... 5.3 啟動(dòng)MySQL并加載InnoDB Plugin這里需要登入MySQL并手動(dòng)加載Plugin相關(guān)的插件:$./bin/mysqld_safe & #啟動(dòng)數(shù)據(jù)庫(kù) $mysql -uroot root>INSTALL PLUGIN INNODB SONAME 'ha_innodb_plugin.so'; root>INSTALL PLUGIN INNODB_TRX SONAME 'ha_innodb_plugin.so'; root>INSTALL PLUGIN INNODB_LOCKS SONAME 'ha_innodb_plugin.so'; root>INSTALL PLUGIN INNODB_LOCK_WAITS SONAME 'ha_innodb_plugin.so'; root>INSTALL PLUGIN INNODB_CMP SONAME 'ha_innodb_plugin.so'; root>INSTALL PLUGIN INNODB_CMP_RESET SONAME 'ha_innodb_plugin.so'; root>INSTALL PLUGIN INNODB_CMPMEM SONAME 'ha_innodb_plugin.so'; root>INSTALL PLUGIN INNODB_CMPMEM_RESET SONAME 'ha_innodb_plugin.so'5.4 查看版本
安裝完成,可以通過(guò)如下命令查看安裝是否成功: root>select @@innodb_version; +------------------+ | @@innodb_version | +------------------+ | 1.0.6 | +------------------+ 1 row in set (0.00 sec) root>show plugins; ......#查看表信息 root> ?SHOW TABLE STATUS FROM `ncweb` LIKE 'tablename';總結(jié)
以上是生活随笔為你收集整理的Mysql InnoDB Plugin安装 install的全部?jī)?nèi)容,希望文章能夠幫你解決所遇到的問(wèn)題。
- 上一篇: datastage 函数_DataSta
- 下一篇: MySQL外键创建失败1005原因总结