找回密码
 注册
查看: 471|回复: 0

ERROR 1071 (42000) at line 162: Specified key was too long; max key length is 76

[复制链接]

1

主题

0

回帖

12

积分

管理员

积分
12
QQ
发表于 2022-10-26 10:00:33 | 显示全部楼层 |阅读模式
ERROR 1071 (42000) at line 162: Specified key was too long; max key length is 767 bytes0 b- Q% [0 H1 n7 G
( s1 r: |2 _% L9 S. {- n& Q
导入数据库时报错:
' e' ?" y# _) ?9 E8 Y: I5 s( W/ p[mysqld]
& N6 d+ H4 v8 ?7 n% w0 c) n7 M( ?/ a4 C. a. X* @5 z; }
innodb_file_format = Barracuda8 V3 g/ R" q( X  z& s
innodb_file_format_check = ON, V, t3 h7 A1 ?# X* |/ ]* k
innodb_file_format_max = Barracuda) ^+ w- I. R$ o& `4 U$ ?3 O* `- o6 z! L* |
[mysql.server]/ N: B, V, |& p+ G
innodb_file_format = Barracuda
. N4 L# E! y' t- U6 Oinnodb_file_format_check = ON1 u& v/ S  R4 X$ T8 b* Q
innodb_file_format_max = Barracuda8 A. ~, I7 P* }7 ?
9 U) L" r4 @; H' P, G7 z
- d9 L) ^' }7 `$ n: D
在my.cnf文件中添加上面信息:. w% \) y4 \4 ~. Q* ]# n

" g. A2 n5 S5 d& I  \8 ccollation-server = utf8mb4_general_ci
$ z! m0 ^3 D' l/ C! Y4 k; uinit-connect = 'SET NAMES utf8mb4'
. Z9 {' n: D" o6 V9 N: j" ucharacter-set-server = utf8mb4
2 v/ n& v4 {9 N5 @6 rinnodb_file_format = Barracuda
$ V# C" ]& [- [+ U& D% k' o! minnodb_file_format_check = ON
+ w' |' }, r3 e$ }  Binnodb_file_format_max = Barracuda
4 I( h/ w# r4 i8 d& _$ ?innodb_large_prefix = ON
5 u* B% d6 N4 f1 h% x, Y3 `[mysql.server]. n% R! a- Z! z/ P) t
innodb_file_format = Barracuda
! a) ?4 u; L, p5 P$ ^0 [' m7 pinnodb_file_format_check = ON3 U* L2 Y( h& q' w
innodb_file_format_max = Barracuda8 K( m# @/ Q, T  q: N/ x8 h
innodb_large_prefix = ON9 x8 S" n% I3 I4 ]" N. g8 e+ U
default-character-set = utf8mb4
% N/ n7 n5 p2 n+ H! J1 v  i+ K. [% Zcharacter_set_server = utf8mb4  m# S! s2 j& e6 R2 |. Z  d  p  w
[client]
8 N1 z- T7 x. y2 ?: b5 Jdefault-character-set = utf8mb4
, Y- f+ M4 W% ]; I$ G; o: [[mysqld_safe]
- p8 ?  F/ M, O% G' H; mdefault-character-set = utf8mb40 v/ R/ U$ H) H. U8 l7 C

, f- ?0 N5 V; @  S3 D
您需要登录后才可以回帖 登录 | 注册

本版积分规则

返回首页|Archiver|手机版|小黑屋|易陆发现技术论坛 ( 蜀ICP备2026014127号-1 )

GMT+8, 2026-6-12 00:13 , Processed in 0.022744 second(s), 22 queries .

Powered by Discuz! X5.0

© 2001-2026 Discuz! Team.

快速回复 返回顶部 返回列表