未知表引擎“InnoDB”

发布于 2024-12-02 19:30:27 字数 477 浏览 1 评论 0原文

最近,我发现如果我有好的硬件,我可以最大限度地提高 mysql 的性能。由于我一直在使用 InnoDB,所以我在 my.ini 中添加了额外的配置,

这是新添加的配置:

innodb_data_file_path = ibdata1:10M:autoextend
innodb_buffer_pool_size = 2G
innodb_additional_mem_pool_size = 2M
innodb_log_file_size = 256M
innodb_log_buffer_size = 8M
innodb_flush_log_at_trx_commit = 1
innodb_lock_wait_timeout = 120

然后我重新启动所有服务。但是当我使用我的程序时,出现错误“未知表引擎'InnoDB'”。

我试图解决这个问题:

  1. 我删除日志文件并重新启动服务,但仍然收到错误。

Recently, I have found out that I can maximize mysql performance when if I have good hardware. Since I've been using InnoDB I added additional configuration into my.ini

Here is the newly added configurations:

innodb_data_file_path = ibdata1:10M:autoextend
innodb_buffer_pool_size = 2G
innodb_additional_mem_pool_size = 2M
innodb_log_file_size = 256M
innodb_log_buffer_size = 8M
innodb_flush_log_at_trx_commit = 1
innodb_lock_wait_timeout = 120

Then I restart all of the services. But when I used my program, an error occurred "Unknown table engine 'InnoDB'".

What I have tried to solve this problem:

  1. I delete the log file the restart the service but I still got the error.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(7

往日 2024-12-09 19:30:27

其他解决方案没有解决我的问题。
调整配置后InnoDB引擎被禁用。

删除 mysql 数据目录中的 borked ib_* 日志文件解决了我的问题,并允许我为 InnoDB 使用 2G 缓冲池:
http://www.turnkeylinux.org /forum/support/20090111/drupal-6-problem-enable-innodb#comment-131

Other solutions did not fix my problem.
InnoDB engine was disabled after adjusting config.

Removing borked ib_* log files in mysql data dir fixed my issue, and allowed me to use 2G buffer pool for InnoDB:
http://www.turnkeylinux.org/forum/support/20090111/drupal-6-problem-enable-innodb#comment-131

流殇 2024-12-09 19:30:27

我刚刚重试删除日志文件并重新启动服务,它起作用了! 但是要注意分配2G,因为innodb可能无法编译,如果2G不起作用,请使用1G

I just retried deleting the logfile and restarted the services, and it works! But beware of allotting 2G because innodb might not compile, please use 1G if 2G doesn't work.

相权↑美人 2024-12-09 19:30:27

我也遇到过这个问题。问题是我为 InnoDB 分配的内存比服务器使用变量 innodb_buffer_pool_size 分配的内存多。 MySQL 并没有抱怨无法在其日志中分配内存。

I have ran into this problem as well. The problem was that I was allocating more memory to InnoDB than the server had with the variable innodb_buffer_pool_size. MySQL did not complain about not being able to allocate the memory in its logs about this.

可爱暴击 2024-12-09 19:30:27

我尝试了所有这些(以及许多其他方法),但对我有用的一种方法是:

  • 停止 MySql Server
    /etc/init.d/mysql stop
  • 删除日志文件
    rm ib_logfile0 ib_logfile1
  • 重命名 InnoDB 文件(如果没有其他效果,因为它将被重新创建)
    mv ibdata1 old_ibdata1
  • 我在/etc/mysql/my.cnf中有这个配置 ->即使您不指定此项,MySql 也会使用默认值。

    <前><代码>[mysqld]
    datadir=/数据/mysql/数据
    套接字=/var/run/mysqld/mysqld.sock

    #不一定要定义以下内容
    innodb_log_file_size=1G
    innodb_file_per_table=1
    innodb_flush_method=O_DIRECT
    innodb_buffer_pool_size=1G
    innodb_data_file_path=ibdata1:10M:自动扩展
    innodb_lock_wait_timeout=18000

  • 启动MySql服务器
    /etc/init.d/mysql start

I tried all of those (and many others) but the one method that worked for me is:

  • Stop MySql Server
    /etc/init.d/mysql stop
  • Delete the log files
    rm ib_logfile0 ib_logfile1
  • Rename the InnoDB file (If nothing else works because it will be recreated)
    mv ibdata1 old_ibdata1
  • I have this configs in /etc/mysql/my.cnf -> Even if you don't specify this, MySql will use the default values.

    [mysqld]
    datadir=/data/mysql/data
    socket=/var/run/mysqld/mysqld.sock
    
    #Not a must to define the following
    innodb_log_file_size=1G
    innodb_file_per_table=1
    innodb_flush_method=O_DIRECT
    innodb_buffer_pool_size=1G
    innodb_data_file_path=ibdata1:10M:autoextend
    innodb_lock_wait_timeout=18000
    
  • Start MySql Server
    /etc/init.d/mysql start

标点 2024-12-09 19:30:27

如果你完全破坏了你的 my.cnf 文件,你可以选择的另一个选择是用 mysql 安装中的默认配置替换它。对于 Linux:

您有以下选项,

/usr/share/mysql/my-huge.cnf
/usr/share/mysql/my-innodb-heavy-4G.cnf
/usr/share/mysql/my-large.cnf
/usr/share/mysql/my-medium.cnf
/usr/share/mysql/my-small.cnf

这是安装它的示例:

#backup original config
mv /etc/my.cnf{,.bak}

#copy new my.cnf from template
cp /usr/share/mysql/my-large.cnf /etc/my.cnf

有关这些选项的更多信息,请访问 http://dev.mysql.com/doc/mysql/en/option-files.html

Another option you have if you mangle your my.cnf file completely is to replace it with a default config from the mysql install there . For linux:

You have the following options,

/usr/share/mysql/my-huge.cnf
/usr/share/mysql/my-innodb-heavy-4G.cnf
/usr/share/mysql/my-large.cnf
/usr/share/mysql/my-medium.cnf
/usr/share/mysql/my-small.cnf

Here is an example to install it:

#backup original config
mv /etc/my.cnf{,.bak}

#copy new my.cnf from template
cp /usr/share/mysql/my-large.cnf /etc/my.cnf

More information on these options is available at http://dev.mysql.com/doc/mysql/en/option-files.html

总以为 2024-12-09 19:30:27

从备份恢复时遇到此问题。问题是我的 my.ini 中有一些不同的设置。因此,如果有人遇到此问题,请务必设置相同的设置(复制 my.ini),停止 MySQL 服务,然后恢复整个数据文件夹,然后再次启动 MySQL 服务。

Had this issue when restoring from backup. Problem was I had a bit different settings in my.ini. So in case someone gets this issue just be sure to set the same settings (copy my.ini), stop the MySQL service, then restore whole data folder and then start the MySQL service again.

公布 2024-12-09 19:30:27

在 MariaDB 10.1 中,应该禁用一个 ignore-builtin-innodb 选项来停止修复错误。

In MariaDB 10.1, there's an ignore-builtin-innodb option that should be disabled to stop fix error.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文