首页 > 数据库 >阿里云数据库RDS迁移导入数据时报错:Specified key was too long; max key length is 767 bytes

阿里云数据库RDS迁移导入数据时报错:Specified key was too long; max key length is 767 bytes

时间:2023-03-25 15:07:13浏览次数:38  
标签:RDS max global large 阿里 报错 key innodb


近期由于新申请了新的阿里云数据库RDS,需要把之前的数据迁移过去,结果通过各种方式去导入数据,都一直报错.

报错信息:Index column size too large. The maximum column size is 767 bytes.

看报错信息,应该是在一个长度大于255的字符的字段上创建unique key报错

解决方式:

1.show variables like 'innodb_large_prefix'; 查看结果是否为ON

set global innodb_large_prefix='on';

2.set global innodb_file_format='Barracuda';\

set global innodb_file_format='Barracuda';

我的是因为第一个状态是OFF,那就需要去阿里云控制台去更改参数了,位置如下:

阿里云数据库RDS迁移导入数据时报错:Specified key was too long; max key length is 767 bytes_数据库

 这里默认是OFF,改为ON提交即可.

搞定,记录下

 

标签:RDS,max,global,large,阿里,报错,key,innodb
From: https://blog.51cto.com/u_15964543/6149480

相关文章