如何在 mysql 5.5.8 中设置 inno db

发布于 2024-11-04 17:34:34 字数 1325 浏览 0 评论 0原文

我正在尝试通过 phpmyadmin 导入功能从 sql 文件恢复数据库。我在尝试导入数据库时​​遇到此错误:

#1064 - You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'TYPE=InnoDB' at line 15 

尝试在 my.ini 中进行操作,并进行了一些编辑:

# Uncomment the following if you are using InnoDB tables
innodb_data_home_dir = C:\wamp\bin\mysql\mysql5.5.8\data/
innodb_data_file_path = ibdata1:10M:autoextend
innodb_log_group_home_dir = C:\wamp\bin\mysql\mysql5.5.8\data/
innodb_log_arch_dir = C:\wamp\bin\mysql\mysql5.5.8\data/
# You can set .._buffer_pool_size up to 50 - 80 %
# of RAM but beware of setting memory usage too high
#innodb_buffer_pool_size = 16M
#innodb_additional_mem_pool_size = 2M
# Set .._log_file_size to 25 % of buffer pool size
#innodb_log_file_size = 5M
#innodb_log_buffer_size = 8M
#innodb_flush_log_at_trx_commit = 1
#innodb_lock_wait_timeout = 50

但我得到了此错误:

#2002 - The server is not responding (or the local MySQL server's socket is not correctly configured) 

尝试在 mysql 控制台中运行显示引擎,并发现对 innodb 的支持设置为默认值。 我没有单独安装mysql,是通过wampserver安装的。主目录和组目录的默认值为 c:\mysql\data,但该目录不存在。所以我所做的就是说:

C:\wamp\bin\mysql\mysql5.5.8\data

我不确定我是否在做正确的事情。我该如何正确地做到这一点?请帮忙。谢谢!

I'm trying to restore a database from an sql file through phpmyadmin import function. I got this error while trying to import the database:

#1064 - You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'TYPE=InnoDB' at line 15 

Tried going around in my.ini, and done some editing:

# Uncomment the following if you are using InnoDB tables
innodb_data_home_dir = C:\wamp\bin\mysql\mysql5.5.8\data/
innodb_data_file_path = ibdata1:10M:autoextend
innodb_log_group_home_dir = C:\wamp\bin\mysql\mysql5.5.8\data/
innodb_log_arch_dir = C:\wamp\bin\mysql\mysql5.5.8\data/
# You can set .._buffer_pool_size up to 50 - 80 %
# of RAM but beware of setting memory usage too high
#innodb_buffer_pool_size = 16M
#innodb_additional_mem_pool_size = 2M
# Set .._log_file_size to 25 % of buffer pool size
#innodb_log_file_size = 5M
#innodb_log_buffer_size = 8M
#innodb_flush_log_at_trx_commit = 1
#innodb_lock_wait_timeout = 50

But I got this error:

#2002 - The server is not responding (or the local MySQL server's socket is not correctly configured) 

Tried running the show engines in mysql console, and found out that support for innodb is set to default.
I didn't install mysql separately, installed it via wampserver. The default for the home dir and group dir is c:\mysql\data, but that directory doesn't exist. So what I did was to put:

C:\wamp\bin\mysql\mysql5.5.8\data

I'm not exactly sure if I'm doing the right thing. How do I do this properly? Please help. Thanks!

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

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

发布评论

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

评论(1

把时间冻结 2024-11-11 17:34:34

首先第一件事。您所做的配置与 MySQL 日志中显示的先前错误无关。

从5.5版本开始,MySQL将DDL语句中的TYPE=INNODB语法更改为ENGINE=INNODB。这意味着您需要检查 Web 应用程序发出的那些受影响的 SQL 语句以纠正问题。

我看到您正在使用 PHPMyAdmin。此包可能不会更新以反映语法更改。查看最新版本的 PHPMyAdmin 并在可能的情况下进行升级。

确保选项文件中没有像my.cnf这样的参数,如下所示:

skip-innodb

否则,即使你正确设置了其他一些参数,Innodb引擎也会被关闭。

或者,要验证 InnoDB 是否是默认存储引擎,您可以在 MySQL 客户端控制台中发出以下命令来确认 InnoDB 是否可用:

SHOW VARIABLES LIKE 'have_innodb';

如果结果为“否”,则您的 mysqld 二进制文件是在没有 InnoDB 支持的情况下编译的,您需要换一张。

顺便说一下,最后一条错误消息提示您检查有关 MySQL 套接字的配置,这可能是一个很好的提示,可以找出 MySQL 选项文件中实际存在的问题。如果您确定MySQL选项文件没有任何错误,您可以尝试终止当前在后台运行的所有MySQL进程,然后再次启动MySQL服务器。这可以确保没有其他 MySQL 进程占用本地套接字。

希望这有帮助!

First thing first. The configuration you've made is irrelevant to the previous error shown in MySQL log.

Since version 5.5, MySQL changed the syntax of TYPE=INNODB to ENGINE=INNODB in DDL statements. This implies you need to review those affected SQL statements issued by your web application in order to rectify the problem.

I see you are using PHPMyAdmin. This package may not be updated to reflect the syntax change. Check out the latest release of PHPMyAdmin and upgrade it if possible.

Make sure there is no such parameter in the option file like my.cnf as follows:

skip-innodb

Otherwise, Innodb engine will be turned off even you have set some other parameters correctly.

Alternatively, to verify if InnoDB is the Default Storage Engine, you may issue the following command in MySQL client console to confirm whether InnoDB is available:

SHOW VARIABLES LIKE 'have_innodb';

If the result is NO, you have a mysqld binary that was compiled without InnoDB support and you need to get a different one.

By the way, the last error message prompt you to check the configuration about MySQL socket which may be a good hint to find out what's wrong actually in MySQL options file. If you are so sure that you haven't got anything wrong in MySQL options file, you can try terminating all MySQL processes currently running at the background before you start up MySQL server again. This makes sure no other MySQL process keeps the local socket occupied.

Hope this helps!

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