Laravel报错:1071 Specified key was too long; max key length is 1000 bytes
Laravel安装,初始化数据库,运行下列命令时候出错
php artisan migrate
解决办法1,设置数据库引擎格式
//临时更改
SET GLOBAL default_storage_engine = 'InnoDB';
永久更改。修改my.cnf(ini),在配置文件里面增加参数default-storage-engine,然后重启数据库服务。
default-storage-engine=InnoDB
解决办法2,编辑文件AppServiceProvider.php
use Illuminate\Support\Facades\Schema;
public function boot()
{
Schema::defaultStringLength(191);
}
Laravel报错:1071 Specified key was too long; max key length is 1000 bytes的更多相关文章
- laravel报错1071 Specified key was too long; max key length is 1000 bytes
Laravel 默认使用utf8mb4字符编码,而不是的utf8编码.因此运行php artisan migrate会出现如下错误: [Illuminate\Database\QueryExcepti ...
- laravel 运行migrate报错 1071 Specified key was too long
转自:https://segmentfault.com/a/1190000008416200 laravel运行命令migrate时报错: 1071 Specified key was too lo ...
- laravel migrate时报错:Syntax error or access violation: 1071 Specified key was too long; max key length is 767 bytes
今天在学习laravel的路由模型绑定时,在按照文档执行php artisan migrate时报错. In Connection.php line 664: SQLSTATE[42000]: Syn ...
- 导入sql文件报错:1071 Specified key was too long; max key length is 767 bytes
ref: https://stackoverflow.com/questions/1814532/1071-specified-key-was-too-long-max-key-length-is-7 ...
- MySQL 报错:[Err] 1071 - Specified key was too long; max key length is 767 bytes
[Err] 1071 - Specified key was too long; max key length is 767 bytes 这个会出现在MySQ5.7以下版本 因为没有启用innodb_ ...
- laravel 错误 1071 Specified key was too long; max key length is 1000 bytes
laravel 执行 php artisan migrate 安装数据库报 1071 Specified key was too long; max key length is 1000 bytes ...
- 【laravel5.4】php artisan migrate报错:Specified key was too long; max key length is 767 bytes
1.原因:在进行 迁移文件生成时,程序并未给varchar类型字段设置 合适的长度,导致报错. 2.解决办法:找到database/ 目标迁移文件,修改其中类型为string的字段长度,建议不要超过2 ...
- vue使用v-for时vscode报错 Elements in iteration expect to have 'v-bind:key' directives
vue使用v-for时vscode报错 Elements in iteration expect to have 'v-bind:key' directives Vue 2.2.0+的版本里,当在组件 ...
- laravel错误1071 Specified key was too long; max key length is 1000 bytes
Laravel 5.5 环境,php artisan migrate 之后,出现错误如题. 检查了一下,代码是这样的: $table->increments('id'); $table-> ...
- hive报错: Specified key was too long; max key length is 767 bytes
废话不多说,报错如下: DataNucleus.Datastore (Log4JLogger.java:error(115)) - An exception was thrown while addi ...
随机推荐
- 同一个tomcat 两个项目 互相访问接口方法
package com.qif.xdqdm.util; import com.alibaba.fastjson.JSONObject; import java.io.*; import java.ne ...
- Android Matrix理论与应用详解
转:http://zensheno.blog.51cto.com/2712776/513652 Matrix学习——基础知识 以前在线性代数中学习了矩阵,对矩阵的基本运算有一些了解,前段时间在使用GD ...
- 段错误 “段错误(segment fault)”、“非法操作,该内存地址不能read/write” 非法指针解引用造成的错误。
[root@test after_fc_distributed]# ./ffmpeg-linux64-v3.3.1 -i "concat:mymp3tmp/test_0.mp3|mymp3t ...
- PAT甲级——A1128 N Queens Puzzle【20】
The "eight queens puzzle" is the problem of placing eight chess queens on an 8 chessboard ...
- Caused by: java.lang.NoSuchMethodError: org.hibernate.engine.spi.SessionFactoryImplementor.getProperties()Ljava/util/Properties;
报错信息 Error starting ApplicationContext. To display the auto-configuration report re-run your applica ...
- USACO 2006 November Gold Fence Repair /// 贪心(有意思)(优先队列) oj23940
题目大意: 输入N ( 1 ≤ N ≤ 20,000 ) :将一块木板分为n块 每次切割木板的开销为这块木板的长度,即将长度为21的木板分为13和8,则开销为21 接下来n行描述每块木板要求的长度Li ...
- 阻止a标签跳转/刷新
<a href='javascript:;' onClick='functionA()'>点击</a> //注意":"."’":均需为英 ...
- 2018-8-10-VisualStudio-2017-项目格式-自动生成版本号
title author date CreateTime categories VisualStudio 2017 项目格式 自动生成版本号 lindexi 2018-08-10 19:16:52 + ...
- 笔记:使用Python解析JSON
使用Python解析JSON json是一种轻量级的数据交换格式,易于阅读和编写. json函数具体作用描述 函数 具体描述作用 json.dumps 将python对象编码为JSON字符串 json ...
- 如果try中有return那么finally中不要有return不然不会执行try中的return
public class TryExer { public static void main(String[] args) { String test = test(); System.out.pri ...