报错一
$ php artisan migrate

Illuminate\Database\QueryException : could not find driver (SQL: select * fr
om information_schema.tables where table_schema = dev_oms and table_name = migra
tions)

at D:\WWW\dev_oms\vendor\laravel\framework\src\Illuminate\Database\Connection.
php:664
660| // If an exception occurs when attempting to run a query, we'll
format the error
661| // message to include the bindings with SQL, which will make th
is exception a
662| // lot more helpful to the developer instead of just the databa
se's errors.
663| catch (Exception $e) {
> 664| throw new QueryException(
665| $query, $this->prepareBindings($bindings), $e
666| );
667| }
668|

Exception trace:

1 PDOException::("could not find driver")
D:\WWW\dev_oms\vendor\laravel\framework\src\Illuminate\Database\Connectors
\Connector.php:68

2 PDO::__construct("mysql:host=127.0.0.1;port=3306;dbname=dev_oms", "root",
"root", [])
D:\WWW\dev_oms\vendor\laravel\framework\src\Illuminate\Database\Connectors
\Connector.php:68

Please use the argument -v to see more details.
原因是php.ini 扩展"php_pdo_mysql.dll"没开启

报错二
$ php artisan migrate
Migration table created successfully.

Illuminate\Database\QueryException : SQLSTATE[42000]: Syntax error or access
violation: 1071 Specified key was too long; max key length is 767 bytes (SQL: a
lter table `users` add unique `users_email_unique`(`email`))

at D:\WWW\dev_oms\vendor\laravel\framework\src\Illuminate\Database\Connection.
php:664
660| // If an exception occurs when attempting to run a query, we'll
format the error
661| // message to include the bindings with SQL, which will make th
is exception a
662| // lot more helpful to the developer instead of just the databa
se's errors.
663| catch (Exception $e) {
> 664| throw new QueryException(
665| $query, $this->prepareBindings($bindings), $e
666| );
667| }
668|

Exception trace:

1 PDOException::("SQLSTATE[42000]: Syntax error or access violation: 1071 Sp
ecified key was too long; max key length is 767 bytes")
D:\WWW\dev_oms\vendor\laravel\framework\src\Illuminate\Database\Connection
.php:458

2 PDOStatement::execute()
D:\WWW\dev_oms\vendor\laravel\framework\src\Illuminate\Database\Connection
.php:458

Please use the argument -v to see more details.
数据库编码改为utf8mb4

报错三
$ php artisan migrate
Migration table created successfully.

Illuminate\Database\QueryException : SQLSTATE[42000]: Syntax error or access
violation: 1071 Specified key was too long; max key length is 767 bytes (SQL: a
lter table `users` add unique `users_email_unique`(`email`))

at D:\WWW\dev_oms\vendor\laravel\framework\src\Illuminate\Database\Connection.
php:664
660| // If an exception occurs when attempting to run a query, we'll
format the error
661| // message to include the bindings with SQL, which will make th
is exception a
662| // lot more helpful to the developer instead of just the databa
se's errors.
663| catch (Exception $e) {
> 664| throw new QueryException(
665| $query, $this->prepareBindings($bindings), $e
666| );
667| }
668|

Exception trace:

1 PDOException::("SQLSTATE[42000]: Syntax error or access violation: 1071 Sp
ecified key was too long; max key length is 767 bytes")
D:\WWW\dev_oms\vendor\laravel\framework\src\Illuminate\Database\Connection
.php:458

2 PDOStatement::execute()
D:\WWW\dev_oms\vendor\laravel\framework\src\Illuminate\Database\Connection
.php:458

Please use the argument -v to see more details.
加上两行代码即可最后一句改成

Schema::defaultStringLength(191);

laravel安装nova 运行php artisan migrate出错的更多相关文章

  1. Laravel 5.7 使用 PHP artisan migrate 的问题

    这是由于Laravel 默认使用 utf8mb4 字符, 包括支持在数据库存储「 表情」 . 如果你正在运行的 MySQL release 版本低于5.7.7 或 MariaDB release版本低 ...

  2. 安装nova后解决登录没账号问题

    找到laravel安装目录执行php artisan nova:user

  3. 【laravel5.4】php artisan migrate报错:Specified key was too long; max key length is 767 bytes

    1.原因:在进行 迁移文件生成时,程序并未给varchar类型字段设置 合适的长度,导致报错. 2.解决办法:找到database/ 目标迁移文件,修改其中类型为string的字段长度,建议不要超过2 ...

  4. 【Laravel】 安装及常用的artisan命令

    composer Laravel 安装 cmd composer create-project laravel/laravel Laravel5 之后自动创建 常用的artisan命令 全局篇 查看a ...

  5. 在 Windows 上快速安装并运行 Laravel 5.x

    安装 PHP 注意一:Laravel 5.0 开始对 PHP 版本的要求是 >=5.4,Laravel 5.1 要求 PHP 版本>=5.5.9,所以,建议大家尽量安装 5.5.x 的最新 ...

  6. laravel中ubuntu下执行php artisan migrate总是报错

    ubuntu14.0 + xampp + laravel5下 laravel中ubuntu下执行php artisan migrate总是报错: [PDOException] could not fi ...

  7. Laravel 运行php artisan serve命令时提示No application encryption key has been specified

    创建了新的laravel项目后, 运行提示:No application encryption key has been specified 解决方法: 这个是由于没有配置好 APP_KEY 在终端上 ...

  8. 解决不安装VC运行库(VC2005,VC2008),程序运行出错的方法

    因为VS2005以后程序采用了manifest的生成方式,所以发布的时候要和运行库一起发布.但是我们平时开发和发布的时候如果都要客户安装运行库,那就不太方便了.你可以Microsoft下载:http: ...

  9. laravel安装 笔记

    http://laod.cn/hosts/2015-google-hosts.html 谷歌FQIP laravel安装和设置流程 1安装composer , VirtualBox和Vagrant 下 ...

随机推荐

  1. Python机器学习实践:决策树判别汽车金融违约用户

    文章发布于公号[数智物语] (ID:decision_engine),关注公号不错过每一篇干货. 转自 | 法纳斯特(公众号ID:walker398) 作者 | 小F 决策树呈树形结构,是一种基本的回 ...

  2. Android SingleTask使用注意点

    在ActivityA中,startActivityForResult到ActivityB,其中ActivityB设置为SingleTask. 那么在实际出现的现象为: ActivityA的onActi ...

  3. vue 导出xlsx表功能

    详细步骤: 1.需要安装三个依赖: npm install -S file-saver xlsx npm install -D script-loader 两个命令行包含三个依赖. 2.项目中src下 ...

  4. Structs2 中拦截器获取请求参数

    前言 环境:window 10,JDK 1.7,Tomcat 7 测试代码 package com.szxy.interceptor; import java.util.Map; import jav ...

  5. Linux(CentOS7)yum安装卸载命令,离线下载安装包

    一.Linux版本 二.yum安装 比如安装vim编辑器,y是自动应答,即默认一路确认,不用中途确认 yum install -y vim 三.yum卸载 比如卸载掉刚刚安装的vim yum eras ...

  6. jquery html() callback

    通过JQuery的.html()函数我们可以非常方便地加载一段HTML到指定的元素中,例如给<div></div>中放入一组图片.问题是JQuery的.html()函数是同步的 ...

  7. Golang代码实现HTTPs(HTTPS证书生成和部署)

    在win7下试试: 1.实现一个最简单的HTTPS Web Server // gohttps/2-https/server.go package main import ( "fmt&qu ...

  8. 【新特性速递】FineUIPro/Mvc/Core 全新移动端访问体验(示例首页)!

    移动端支持 虽然 FineUIPro 早在 2016 年就已经完成对移动端的适配工作,并新增了 50 多个官网示例. 并且,我们也新增了一个移动端的首页 http://pro.fineui.com/m ...

  9. EntityFramework Core进行读写分离最佳实践方式,了解一下(一)?

    前言 本来打算写ASP.NET Core MVC基础系列内容,看到有园友提出如何实现读写分离,这个问题提的好,大多数情况下,对于园友在评论中提出的问题,如果是值得深究或者大多数同行比较关注的问题我都会 ...

  10. 随心测试_数据库_002 <数据库系统组成>

    软测工程师:作为综合运用多学科知识,保障软件质量的重要岗位.需要我们学以致用,在工作中不断学习提升.以下:软测人员必备_数据库核心技能学习点,供大家学习参考. 数据库系统组成_必备 1. 简介:数据库 ...