如何開啟mysql的innodb引擎

如何開啟MySQL的innodb引擎,相信很多沒有經(jīng)驗(yàn)的人對(duì)此束手無策,為此本文總結(jié)了問題出現(xiàn)的原因和解決方法,通過這篇文章希望你能解決這個(gè)問題。

讓客戶滿意是我們工作的目標(biāo),不斷超越客戶的期望值來自于我們對(duì)這個(gè)行業(yè)的熱愛。我們立志把好的技術(shù)通過有效、簡單的方式提供給客戶,將通過不懈努力成為客戶在信息化領(lǐng)域值得信任、有價(jià)值的長期合作伙伴,公司提供的服務(wù)項(xiàng)目有:申請(qǐng)域名、網(wǎng)站空間、營銷軟件、網(wǎng)站建設(shè)、沂水網(wǎng)站維護(hù)、網(wǎng)站推廣。



開啟mysql的innodb引擎

環(huán)境:
mysql版本 5.1.51
os:rhel 5.4 32bit
mysql安裝目錄為/mysql
mysql 的數(shù)據(jù)目錄/mysql/data

安裝之前
[root@odb1 plugin]# pwd
/mysql/lib/mysql/plugin
[root@odb1 plugin]# 
[root@odb1 plugin]# ls -l ha_innodb*
-rw-r--r-- 1 root root 6207320 Mar 26 01:04 ha_innodb.a
-rwxr-xr-x 1 root root    1005 Mar 26 01:04 ha_innodb.la
-rw-r--r-- 1 root root 7064416 Mar 26 01:04 ha_innodb_plugin.a
-rwxr-xr-x 1 root root    1054 Mar 26 01:04 ha_innodb_plugin.la
lrwxrwxrwx 1 root root      25 Mar 26 01:04 ha_innodb_plugin.so -> ha_innodb_plugin.so.0.0.0
lrwxrwxrwx 1 root root      25 Mar 26 01:04 ha_innodb_plugin.so.0 -> ha_innodb_plugin.so.0.0.0
-rwxr-xr-x 1 root root 5032879 Mar 26 01:04 ha_innodb_plugin.so.0.0.0
lrwxrwxrwx 1 root root      18 Mar 26 01:04 ha_innodb.so -> ha_innodb.so.0.0.0
lrwxrwxrwx 1 root root      18 Mar 26 01:04 ha_innodb.so.0 -> ha_innodb.so.0.0.0
-rwxr-xr-x 1 root root 4560527 Mar 26 01:04 ha_innodb.so.0.0.0
[root@odb1 plugin]# 
[root@odb1 plugin]# ls -l ha_innodb*.so
lrwxrwxrwx 1 root root 25 Mar 26 01:04 ha_innodb_plugin.so -> ha_innodb_plugin.so.0.0.0
lrwxrwxrwx 1 root root 18 Mar 26 01:04 ha_innodb.so -> ha_innodb.so.0.0.0
[root@odb1 plugin]# 

啟動(dòng)mysql服務(wù)器,然后安裝innodb
mysql> show variables like '%plugin_dir%';
+---------------+---------------------------------+
| Variable_name | Value                           |
+---------------+---------------------------------+
| plugin_dir    | /mysql/lib/mysql/plugin |
+---------------+---------------------------------+
1 row in set (0.00 sec)

mysql> 
mysql> INSTALL PLUGIN InnoDB SONAME 'ha_innodb.so';
Query OK, 0 rows affected (0.52 sec)

mysql> 
mysql> show engines;
+------------+---------+------------------------------------------------------------+--------------+------+------------+
| Engine     | Support | Comment                                                    | Transactions | XA   | Savepoints |
+------------+---------+------------------------------------------------------------+--------------+------+------------+
| CSV        | YES     | CSV storage engine                                         | NO           | NO   | NO         |
| InnoDB     | YES     | Supports transactions, row-level locking, and foreign keys | YES          | YES  | YES        |
| MEMORY     | YES     | Hash based, stored in memory, useful for temporary tables  | NO           | NO   | NO         |
| MyISAM     | DEFAULT | Default engine as of MySQL 3.23 with great performance     | NO           | NO   | NO         |
| MRG_MYISAM | YES     | Collection of identical MyISAM tables                      | NO           | NO   | NO         |
+------------+---------+------------------------------------------------------------+--------------+------+------------+
5 rows in set (0.00 sec)

mysql> 

--執(zhí)行如下命令時(shí)
INSTALL PLUGIN InnoDB SONAME 'ha_innodb.so';

err日志輸出

[root@odb1 data]# pwd
/mysql/data
[root@odb1 data]# 
[root@odb1 data]# ls -l
total 20556
-rw-rw---- 1 mysql mysql 10485760 Apr  2 21:18 ibdata1
-rw-rw---- 1 mysql mysql  5242880 Apr  2 21:18 ib_logfile0
-rw-rw---- 1 mysql mysql  5242880 Apr  2 21:18 ib_logfile1
drwx------ 2 mysql root      4096 Mar 26 01:17 mysql
-rw-rw---- 1 mysql mysql      409 Mar 27 20:53 odb1.log
-rw-rw---- 1 mysql root     15246 Apr  2 21:18 odb1.test.com.err
-rw-rw---- 1 mysql mysql        6 Apr  2 21:01 odb1.test.com.pid
drwx------ 2 mysql root      4096 Apr  2 19:04 test
drwx------ 2 mysql mysql     4096 Apr  2 19:10 test2
[root@odb1 data]# 

more odb1.test.com.err

160402 21:01:25 mysqld_safe Starting mysqld daemon with databases from /mysql/data
160402 21:01:25 [Warning] '--skip-locking' is deprecated and will be removed in a future release. Please use '--skip-external-locking' instead.
160402 21:01:25 [Warning] '--log_slow_queries' is deprecated and will be removed in a future release. Please use ''--slow_query_log'/'--slow_query_log_file'' instead.
160402 21:01:25 [Note] Event Scheduler: Loaded 0 events
160402 21:01:25 [Note] /mysql/libexec/mysqld: ready for connections.
Version: '5.1.51-log'  socket: '/tmp/mysql.sock'  port: 3306  Source distribution
InnoDB: The first specified data file ./ibdata1 did not exist:
InnoDB: a new database to be created!
160402 21:18:49  InnoDB: Setting file ./ibdata1 size to 10 MB
InnoDB: Database physically writes the file full: wait...
160402 21:18:49  InnoDB: Log file ./ib_logfile0 did not exist: new to be created
InnoDB: Setting log file ./ib_logfile0 size to 5 MB
InnoDB: Database physically writes the file full: wait...
160402 21:18:49  InnoDB: Log file ./ib_logfile1 did not exist: new to be created
InnoDB: Setting log file ./ib_logfile1 size to 5 MB
InnoDB: Database physically writes the file full: wait...
InnoDB: Doublewrite buffer not found: creating new
InnoDB: Doublewrite buffer created
InnoDB: Creating foreign key constraint system tables
InnoDB: Foreign key constraint system tables created
160402 21:18:49  InnoDB: Started; log sequence number 0 0

==================================================================================

啟停mysql

[root@odb1 data]# service mysql start
Starting MySQL.[  OK  ]
[root@odb1 data]# 
[root@odb1 data]# 
[root@odb1 data]# service mysql stop
Shutting down MySQL....[  OK  ]

err日志輸出

--啟動(dòng)
160402 21:27:20 mysqld_safe Starting mysqld daemon with databases from /mysql/data
160402 21:27:20 [Warning] '--skip-locking' is deprecated and will be removed in a future release. Please use '--skip-external-locking' instead.
160402 21:27:20 [Warning] '--log_slow_queries' is deprecated and will be removed in a future release. Please use ''--slow_query_log'/'--slow_query_log_file'' instead.
160402 21:27:20  InnoDB: Started; log sequence number 0 44233
160402 21:27:20 [Note] Event Scheduler: Loaded 0 events
160402 21:27:20 [Note] /mysql/libexec/mysqld: ready for connections.
Version: '5.1.51-log'  socket: '/tmp/mysql.sock'  port: 3306  Source distribution

--關(guān)閉
160402 21:28:27 [Note] /mysql/libexec/mysqld: Normal shutdown

160402 21:28:27 [Note] Event Scheduler: Purging the queue. 0 events
160402 21:28:27  InnoDB: Starting shutdown...
160402 21:28:30  InnoDB: Shutdown completed; log sequence number 0 44233
160402 21:28:30 [Note] /mysql/libexec/mysqld: Shutdown complete

160402 21:28:30 mysqld_safe mysqld from pid file /mysql/data/odb1.test.com.pid ended

看完上述內(nèi)容,你們掌握如何開啟mysql的innodb引擎的方法了嗎?如果還想學(xué)到更多技能或想了解更多相關(guān)內(nèi)容,歡迎關(guān)注創(chuàng)新互聯(lián)行業(yè)資訊頻道,感謝各位的閱讀!

分享名稱:如何開啟mysql的innodb引擎
URL鏈接:http://bm7419.com/article28/igejcp.html

成都網(wǎng)站建設(shè)公司_創(chuàng)新互聯(lián),為您提供定制網(wǎng)站、電子商務(wù)、做網(wǎng)站、網(wǎng)站設(shè)計(jì)企業(yè)網(wǎng)站制作、網(wǎng)站策劃

廣告

聲明:本網(wǎng)站發(fā)布的內(nèi)容(圖片、視頻和文字)以用戶投稿、用戶轉(zhuǎn)載內(nèi)容為主,如果涉及侵權(quán)請(qǐng)盡快告知,我們將會(huì)在第一時(shí)間刪除。文章觀點(diǎn)不代表本網(wǎng)站立場(chǎng),如需處理請(qǐng)聯(lián)系客服。電話:028-86922220;郵箱:631063699@qq.com。內(nèi)容未經(jīng)允許不得轉(zhuǎn)載,或轉(zhuǎn)載時(shí)需注明來源: 創(chuàng)新互聯(lián)

成都app開發(fā)公司