未能将innodb设置为Ubuntu 10.04的默认引擎

我有一个问题设置innodb作为Ubuntu 10.04上的MySQL 5.1的默认数据库引擎。 只要我切换到innodb作为默认引擎服务器拒绝启动。 这是我在启用innodb之后尝试启动MySQL时在syslog中得到的内容:

Oct 6 21:18:29 artemis init: mysql main process ended, respawning Oct 6 21:18:58 artemis init: mysql post-start process (5825) terminated with status 1 Oct 6 21:18:59 artemis init: mysql main process (5943) terminated with status 7 Oct 6 21:18:59 artemis init: mysql main process ended, respawning Oct 6 21:19:28 artemis init: mysql post-start process (5944) terminated with status 1 Oct 6 21:19:29 artemis init: mysql main process (6056) terminated with status 7 Oct 6 21:19:29 artemis init: mysql main process ended, respawning Oct 6 21:19:58 artemis init: mysql post-start process (6057) terminated with status 1 Oct 6 21:20:00 artemis init: mysql main process (6163) terminated with status 7 Oct 6 21:20:00 artemis init: mysql main process ended, respawning Oct 6 21:20:28 artemis init: mysql post-start process (6164) terminated with status 1 Oct 6 21:20:30 artemis init: mysql main process (6239) terminated with status 7 Oct 6 21:20:30 artemis init: mysql main process ended, respawning Oct 6 21:20:59 artemis init: mysql post-start process (6240) terminated with status 1 Oct 6 21:21:00 artemis init: mysql main process (6358) terminated with status 7 Oct 6 21:21:00 artemis init: mysql main process ended, respawning Oct 6 21:21:29 artemis init: mysql post-start process (6359) terminated with status 1 Oct 6 21:21:30 artemis init: mysql main process (6434) terminated with status 7 Oct 6 21:21:30 artemis init: mysql main process ended, respawning Oct 6 21:21:59 artemis init: mysql post-start process (6435) terminated with status 1 Oct 6 21:22:01 artemis init: mysql main process (6540) terminated with status 7 Oct 6 21:22:01 artemis init: mysql main process ended, respawning 

试图删除任何干扰程序,我卸载apparmor并重新启动。 在干净的安装之后,实际上删除dirs / etc / mysql和/ var / lib / mysql以确保没有陈旧的文件,服务器启动就好了,MyIsam作为默认引擎。 InnoDB是显示引擎时可用的引擎之一:

 +------------+---------+----------------------------------------------------------------+--------------+------+------------+ | Engine | Support | Comment | Transactions | XA | Savepoints | +------------+---------+----------------------------------------------------------------+--------------+------+------------+ | InnoDB | YES | Supports transactions, row-level locking, and foreign keys | YES | YES | YES | | MRG_MYISAM | YES | Collection of identical MyISAM tables | NO | NO | NO | | BLACKHOLE | YES | /dev/null storage engine (anything you write to it disappears) | NO | NO | NO | | CSV | YES | CSV storage engine | NO | NO | NO | | MEMORY | YES | Hash based, stored in memory, useful for temporary tables | NO | NO | NO | | FEDERATED | NO | Federated MySQL storage engine | NULL | NULL | NULL | | ARCHIVE | YES | Archive storage engine | NO | NO | NO | | MyISAM | DEFAULT | Default engine as of MySQL 3.23 with great performance | NO | NO | NO | +------------+---------+----------------------------------------------------------------+--------------+------+------------+ 8 rows in set (0.00 sec) 

InnoDBconfiguration我已经尝试过了,并附在mysql-server-5.1软件包附带的默认my.cnf中的[mysqld]下面,如下所示:

 # TEST ##################################################### init_connect='SET collation_connection = utf8_general_ci; SET NAMES utf8;' default-character-set=utf8 character-set-server=utf8 collation-server=utf8_general_ci skip-character-set-client-handshake max_allowed_packet = 16M # Network buffer length (I think this is the linux default) #net_buffer_length = 8K # Query caching query_cache_type = 1 # Default table storage engine when creating new tables # (comment out when running mysql_install_db) #default_storage_engine=InnoDB #default_table_type=InnoDB # Default transaction isolation level, levels available are: # READ-UNCOMMITTED, READ-COMMITTED, REPEATABLE-READ, SERIALIZABLE # see: http://dev.mysql.com/doc/refman/5.1/en/set-transaction.html transaction_isolation = READ-COMMITTED innodb_data_file_path = ibdata1:50M:autoextend # TEST ##################################################### 

我可以添加上面的代码片段而不会引起任何麻烦,但只要我取消注释default_storage_engine = InnoDB或default_table_type = InnoDB,服务器将不会启动。 再次评论这些行并重新启动InnoDB在列出的引擎中缺失。

  mysql> show engines; +------------+---------+----------------------------------------------------------------+--------------+------+------------+ | Engine | Support | Comment | Transactions | XA | Savepoints | +------------+---------+----------------------------------------------------------------+--------------+------+------------+ | 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 | | BLACKHOLE | YES | /dev/null storage engine (anything you write to it disappears) | NO | NO | NO | | CSV | YES | CSV storage engine | NO | NO | NO | | MEMORY | YES | Hash based, stored in memory, useful for temporary tables | NO | NO | NO | | FEDERATED | NO | Federated MySQL storage engine | NULL | NULL | NULL | | ARCHIVE | YES | Archive storage engine | NO | NO | NO | +------------+---------+----------------------------------------------------------------+--------------+------+------------+ 7 rows in set (0.00 sec) 

我做错了什么,缺什么? 任何暗示,可以揭示一些这一点表示赞赏。

干杯! // 约翰

我安装MySQL服务器(Ubuntu 10.04):

 apt-get install mysql-server 

然后检查默认引擎(MyISAM):

 mysql> show engines; +------------+---------+----------------------------------------------------------------+--------------+------+------------+ | Engine | Support | Comment | Transactions | XA | Savepoints | +------------+---------+----------------------------------------------------------------+--------------+------+------------+ | InnoDB | YES | Supports transactions, row-level locking, and foreign keys | YES | YES | YES | | MRG_MYISAM | YES | Collection of identical MyISAM tables | NO | NO | NO | | BLACKHOLE | YES | /dev/null storage engine (anything you write to it disappears) | NO | NO | NO | | CSV | YES | CSV storage engine | NO | NO | NO | | MEMORY | YES | Hash based, stored in memory, useful for temporary tables | NO | NO | NO | | FEDERATED | NO | Federated MySQL storage engine | NULL | NULL | NULL | | ARCHIVE | YES | Archive storage engine | NO | NO | NO | | MyISAM | DEFAULT | Default engine as of MySQL 3.23 with great performance | NO | NO | NO | +------------+---------+----------------------------------------------------------------+--------------+------+------------+ 

然后更改/etc/mysql/my.cnf – 在mysqld部分添加default-storage-engine = innodb:

 [mysqld] # # * Basic Settings # # # * IMPORTANT # If you make changes to these settings and your system uses apparmor, you may # also need to also adjust /etc/apparmor.d/usr.sbin.mysqld. # user = mysql socket = /var/run/mysqld/mysqld.sock port = 3306 basedir = /usr datadir = /var/lib/mysql tmpdir = /tmp skip-external-locking default-storage-engine = innodb 

有用:

 mysql> show engines; +------------+---------+----------------------------------------------------------------+--------------+------+------------+ | Engine | Support | Comment | Transactions | XA | Savepoints | +------------+---------+----------------------------------------------------------------+--------------+------+------------+ | InnoDB | DEFAULT | Supports transactions, row-level locking, and foreign keys | YES | YES | YES | | MRG_MYISAM | YES | Collection of identical MyISAM tables | NO | NO | NO | | BLACKHOLE | YES | /dev/null storage engine (anything you write to it disappears) | NO | NO | NO | | CSV | YES | CSV storage engine | NO | NO | NO | | MEMORY | YES | Hash based, stored in memory, useful for temporary tables | NO | NO | NO | | FEDERATED | NO | Federated MySQL storage engine | NULL | NULL | NULL | | ARCHIVE | YES | Archive storage engine | NO | NO | NO | | MyISAM | YES | Default engine as of MySQL 3.23 with great performance | NO | NO | NO | +------------+---------+----------------------------------------------------------------+--------------+------+------------+