MySQL错误:最大列大小为767个字节 [英] MySQL error: The maximum column size is 767 bytes

查看:545
本文介绍了MySQL错误:最大列大小为767个字节的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

当我运行一个对MySQL有用的程序时,我收到以下错误消息:

When I run a program which does something with MySQL, I got this error message:

2015-06-10 15:41:12,250错误app.wsutils 419 INCRON:错误:('HY000', '[HY000] [MySQL] [ODBC 5.2(w)驱动程序] [mysqld-5.7.7-rc-log]索引列 尺寸太大.最大列大小为767个字节. (1709) (SQLExecDirectW)')

2015-06-10 15:41:12,250 ERROR app.wsutils 419 INCRON: Error: ('HY000', '[HY000] [MySQL][ODBC 5.2(w) Driver][mysqld-5.7.7-rc-log]Index column size too large. The maximum column size is 767 bytes. (1709) (SQLExecDirectW)')

我用Google搜索了一下,发现此错误可能与innodb_large_prefix选项有关.但是,我使用的是MySQL 5.7.7 rc,它已经将innodb_large_prefix设置为"ON"(在MySQL Workbench中选中),最多允许3072个字节.我不确定这是否是innodb_large_prefix的问题.

I Googled a little bit, and found this error might be relating to the innodb_large_prefix option. However, I am using MySQL 5.7.7 rc, which has already set innodb_large_prefix to be "ON" (checked in MySQL Workbench), allowing up to 3072 bytes. I am not sure if that is the problem with innodb_large_prefix or not.

无论如何,有人知道如何解决此问题吗?

Anyway, does anyone have an idea how to fix this problem?

推荐答案

借助BK435给出的答案,我执行了以下操作并解决了问题.

With the help of the answer given by BK435, I did the following and solved the problem.

set global innodb_file_format = BARRACUDA;
set global innodb_large_prefix = ON;
create table test (........) ENGINE=InnoDB DEFAULT CHARSET=utf8 ROW_FORMAT=DYNAMIC;

这篇关于MySQL错误:最大列大小为767个字节的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆