当前位置:网站首页>The SQL file of mysql8.0 was imported into version 5.5. There was a pit

The SQL file of mysql8.0 was imported into version 5.5. There was a pit

2022-06-13 05:50:00 sjgeng111

first : Character encoding problem

error :

Unknown collation: ‘utf8mb4_0900_ai_ci‘......

resolvent :
Manually modify sql file :

utf8mb4_0900_ai_ci Replace all with utf8_general_ci
utf8mb4 Replace with utf8

the second :TIMESTAMP Type problem

error :

Incorrect table definition; there can be only one TIMESTAMP column with CURRENT_TIMESTAMP in DEFAULT 

The reason is when you give a timestamp Set to on updatecurrent_timestamp When , Other timestamp Fields need to be explicitly set default value . But if you have two timestamp Field , Set only the first to current_timestamp And the second one doesn't have a default , You're going to report a mistake
resolvent :
Set default values for several other fields :
 Insert picture description here

 DEFAULT '0000-00-00 00:00:00' 

Third : Character length problem :

error :

Specified key was too long; max key length is 767 bytes

resolvent :
stay utf-8 Character set ,255 success ,utf-8 One character takes up 3 Bytes ,255*3=765 mysql5.6 The longest index is 767.

原网站

版权声明
本文为[sjgeng111]所创,转载请带上原文链接,感谢
https://yzsam.com/2022/02/202202280507157521.html