报错一
$ 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. 豆瓣top250(go版以及python版)

      最近学习go,就找了一个例子练习[go语言爬虫]go语言爬取豆瓣电影top250,思路大概就是获取网页,然后根据页面元素,用正则表达式匹配电影名称.评分.评论人数.原文有个地方需要修改下patte ...

  2. Spinner之下拉多选,监听ID后显示不同Frgment页面

    本人安卓小白,公司最近项目需要用到不同的类型的用户注册,周末下午写完记录一下. 网上找了一堆没有适合自己的(或者说我没找到),写的比较基础,欢迎大家多多指导. 老规矩,先上效果图 网上在线合成的GIF ...

  3. Java导出Excel的Springmvc实例

     @RequestMapping(value = "downloadExcel", method = RequestMethod.GET)  public String downl ...

  4. 简单易懂的单元测试框架-gtest(一)

    简介     gtest是google开源的一个单元测试框架,以其简单易学的特点被广泛使用.该框架以第三方库的方式插入被测代码中.同其他单元测试框架相似,gtest也通过制作测试样例来进行代码测试.同 ...

  5. Jar 初步

    前言 jar 是 java 文件中一种文件格式,用于将 .java 文件编译的字节码文件打包成 jar. 给 Java 应用打包 1. 新建一个 java 源文件 package cn.szxy; p ...

  6. 简单介绍python的双向队列

    介绍 大家都知道利用 .append 和 .pop 方法,我们可以把列表当作栈或者队列来用(比如,把 append 和 pop(0) 合起来用,就能模拟栈的“先进先出”的特点).但是删除列表的第一个元 ...

  7. JQuery 图片轮播,详细注释说明,让你一看就会!

    准备工作: 1.准备几张大小相同的图片 完成功能: 1.自动轮播 2.手动轮播 3.点击二侧按钮前后切换图片 JQuery插件地址: 链接:https://pan.baidu.com/s/1zNl2- ...

  8. QTableWidget class

    Help on class QTableWidget in module PyQt5.QtWidgets: class QTableWidget(QTableView)  |  QTableWidge ...

  9. apose和spire操作word

    Apose public void doSaveAsword(Dictionary<string,string> dict) { //--------------------------- ...

  10. pycharm 远程调试代码

    我们在本地开发的时候,有时候需要使用到远程服务器的环境,如我们在调试微信或支付宝支付的时候. 那我们如何通过本地pycharm环境连接远程服务器进行调试呢? 1.pycharm和远程服务器连接 1)点 ...