博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
那些从MySQL5.6升级到5.7的坑--innodb_large_prefix
阅读量:6999 次
发布时间:2019-06-27

本文共 2787 字,大约阅读时间需要 9 分钟。

$mysql -uroot -pWelcome to the MySQL monitor.  Commands end with ; or \g.Your MySQL connection id is 4708773Server version: 5.6.16.12-20161009-log Source distribution Copyright (c) 2000, 2014, Oracle and/or its affiliates. All rights reserved. Oracle is a registered trademark of Oracle Corporation and/or itsaffiliates. Other names may be trademarks of their respectiveowners.mysql> CREATE TABLE `cc` (    ->   `id` int(11) NOT NULL AUTO_INCREMENT,    ->   `c` varchar(255) DEFAULT NULL,    ->   PRIMARY KEY (`id`),    ->   KEY `idx_c` (`c`)    -> ) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8mb4;Query OK, 0 rows affected, 1 warning (0.01 sec) mysql> show warnings;+---------+------+---------------------------------------------------------+| Level   | Code | Message                                                 |+---------+------+---------------------------------------------------------+| Warning | 1071 | Specified key was too long; max key length is 767 bytes |+---------+------+---------------------------------------------------------+1 row in set (0.00 sec) mysql> show create table cc\G*************************** 1. row ***************************       Table: ccCreate Table: CREATE TABLE `cc` (  `id` int(11) NOT NULL AUTO_INCREMENT,  `c` varchar(255) DEFAULT NULL,  PRIMARY KEY (`id`),  KEY `idx_c` (`c`(191))) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8mb41 row in set (0.00 sec)mysql> show global variables like "innodb_large_prefix";+---------------------+-------+| Variable_name       | Value |+---------------------+-------+| innodb_large_prefix | OFF   |+---------------------+-------+1 row in set (0.00 sec)复制代码

$mysql -uroot -pEntry Port ==== 3313Welcome to the MySQL monitor.  Commands end with ; or \g.Your MySQL connection id is 9304Server version: 5.7.13.1-AliSQL-20160928-log Source distribution Copyright (c) 2000, 2016, Oracle and/or its affiliates. All rights reserved. Oracle is a registered trademark of Oracle Corporation and/or itsaffiliates. Other names may be trademarks of their respectiveowners. Type 'help;' or '\h' for help. Type '\c' to clear the current input statement. root@test 02:23:11>CREATE TABLE `cc` (    ->   `id` int(11) NOT NULL AUTO_INCREMENT,    ->   `c` varchar(255) DEFAULT NULL,    ->   PRIMARY KEY (`id`),    ->   KEY `idx_c` (`c`)    -> ) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8mb4;Query OK, 0 rows affected (0.00 sec) root@test 02:25:46>show warnings;Empty set (0.00 sec) root@test 02:26:17>show global variables like "innodb_large_prefix";+---------------------+-------+| Variable_name       | Value |+---------------------+-------+| innodb_large_prefix | ON    |+---------------------+-------+1 row in set (0.00 sec) root@test 02:28:43>复制代码

转载于:https://juejin.im/post/5a814463f265da4e8700caed

你可能感兴趣的文章
Mysql中使用流式查询避免数据量过大导致OOM
查看>>
为什么中台是传统企业数字化转型的关键?
查看>>
中国技术开放日专场在美国旧金山隆重开幕
查看>>
从责任界定和问题预警角度 解读全栈溯源对DevOps的价值
查看>>
百度发布开源智能边缘计算平台OpenEdge
查看>>
JavaScript引擎V8 5.1遵循了更多的ECMAScript规范并支持WASM
查看>>
广度、深度、易用性,详解6大机器学习云
查看>>
雇佣和留住开发人员,打造优秀的团队
查看>>
关于5G被激烈讨论的那些争端和冲突
查看>>
Jenkins部署码云SpringBoot项目
查看>>
抛弃NVelocity,来玩玩Razor
查看>>
在JavaScript面向对象编程中使用继承(1)
查看>>
高铁与机场成交通信息化建设的双驾马车
查看>>
chmod命令
查看>>
货币的起源和职能是什么?绘制货币资金管理思维导图简单的方法介绍
查看>>
springboot+kafka+elk+docker+docker-compose+centos搭建日志收集系统
查看>>
时讯无线如何满足商业区的无线覆盖?
查看>>
2014最新open***搭建实例
查看>>
WinAPI: midiOutCachePatches - 预装音色
查看>>
finally执行顺序
查看>>