报错一
$ 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.
加上两行代码即可
以上这篇laravel执行php artisan migrate报错的解决方法就是小编分享给大家的全部内容了,希望能给大家一个参考,也希望大家多多支持小牛知识库。
本文向大家介绍maven deploy时报错的解决方法,包括了maven deploy时报错的解决方法的使用技巧和注意事项,需要的朋友参考一下 今天在发布maven工程的时候,很奇怪,因为在本地package,install等等都没问题,但是打包的时候就是报错,日志如下: [ERROR] Failed to execute goal org.apache.maven.plugins:maven-d
E立方管理平台表单填报时超链接不能使用,点击这些超链接出现“由于本机的限制,该操作已被取消,请与系统管理员联系”的提示,可用以下方法解决: 一、Office 2003 解决方法:IE - 工具 - Internet选项,点“程序”,在“默认的WEB浏览器”中点“设为默认值”,就可以解决这个问题,在EXCEL中点链接不再提示“由于本机的限制,该操作已被取消,请与系统管理员联系”这个信息了
本文向大家介绍Android Studio 报错“app:processDebugResources"解决方法,包括了Android Studio 报错“app:processDebugResources"解决方法的使用技巧和注意事项,需要的朋友参考一下 Android Studio 报错“app:processDebugResources"解决方法 Android Studio项目Build的时
本文向大家介绍gem install redis报错的解决方案,包括了gem install redis报错的解决方案的使用技巧和注意事项,需要的朋友参考一下 在使用ruby脚本安装Redis集群时,需要先安装Ruby语言环境和redis插件,但是安装redis插件时遇到以下报错,下面记录一下解决过程。 因为执行Ruby脚本需要Ruby语言环境,所以首先安装Ruby语言环境和Ruby的包管理器Ge
本文向大家介绍node.js缺少mysql模块运行报错的解决方法,包括了node.js缺少mysql模块运行报错的解决方法的使用技巧和注意事项,需要的朋友参考一下 发现问题 在用node.js连接数据库,运行报错:cannot find module 'mysql; 然后 在管理员和用户下分别用npm安装数据库但是都是失败: 解决方法 按照错误日志应该是找不到文件夹,无法打开package.jso
本文向大家介绍db.serverStatus()命名执行时报无权限问题的解决方法,包括了db.serverStatus()命名执行时报无权限问题的解决方法的使用技巧和注意事项,需要的朋友参考一下 1、问题描述 今天在执行db.serverStatus()命令时给出了“ "errmsg" : "not authorized on admin to execute command { serverSt