商会资讯

 找回密码
 立即注册

QQ登录

只需一步,快速开始

用新浪微博连接

一步搞定

搜索
热搜: 活动 交友 discuz
查看: 7238|回复: 0
打印 上一主题 下一主题

MYSQL have_innodb DISABLED无法创建innodb类型的表

[复制链接]

109

主题

1

好友

3774

积分

管理员

Rank: 9Rank: 9Rank: 9

  • ta_mind
    mb_qb7
    2013-3-19 01:56
  • classn_01: 366 classn_02

    [LV.9]以坛为家II

    跳转到指定楼层
    楼主
    发表于 2016-12-20 16:22:13 |只看该作者 |倒序浏览
    今天在一台MYSQL服务器上发现,明明用了engine=innodb创建的表,结果创建出来却成了myisam的表。再看show variables like '%innodb%';

    have_innodb 成了DISABLED。经过一番试验,发现是我关闭数据库后,直接删除ibdata1文件造成的。删除该文件以后,重启数据库,日志文件中会有:
    060330 17:22:07  mysqld started
    InnoDB: The first specified data file ./ibdata1 did not exist:
    InnoDB: a new database to be created!
    060330 17:22:07  InnoDB: Setting file ./ibdata1 size to 10 MB
    InnoDB: Database physically writes the file full: wait...
    InnoDB: Error: all log files must be created at the same time.
    InnoDB: All log files must be created also in database creation.
    InnoDB: If you want bigger or smaller log files, shut down the
    InnoDB: database and make sure there were no errors in shutdown.
    InnoDB: Then delete the existing log files. Edit the .cnf file
    InnoDB: and start the database again.
    060330 17:22:07 [Note] /usr/sbin/mysqld: ready for connections.
    Version: '5.0.19-standard-log'  socket: '/var/lib/mysql/mysql.sock'  port: 3306  MySQL Community Edition - Standard (GPL)
    060330 17:22:26 [Note] /usr/sbin/mysqld: Normal shutdown
    看来只删除ibdata1文件是不行的,于是再度关闭数据库,把ibdata1和ib_logfile1、ib_logfile0统统删除,再启动,have_innodb 就变成Yes了。

    分享到: QQ空间QQ空间 腾讯微博腾讯微博 腾讯朋友腾讯朋友
    分享分享0 收藏收藏0 转发到微博
    回复

    使用道具 举报

    您需要登录后才可以回帖 登录 | 立即注册

    回顶部