phplaravel怎么优化(laravel执行php artisan migrate报错的解决方法)
类别:编程学习 浏览量:409
时间:2021-10-10 00:54:59 phplaravel怎么优化
laravel执行php artisan migrate报错的解决方法报错一
$ 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报错的解决方法就是小编分享给大家的全部内容了,希望能给大家一个参考,也希望大家多多支持免费资源网。
原文链接:https://blog.csdn.net/Code_Pupil/article/details/80371145
您可能感兴趣
- laravel关联模型新增数据(使用laravel的migrate创建数据表的方法)
- phplaravel怎么优化(laravel执行php artisan migrate报错的解决方法)
- laravel队列流程(Laravel 创建指定表 migrate的例子)
- 红色代表什么(红色代表什么情感和含义)
- 南宋志南和尚绝句 杨柳风似庙中来(南宋志南和尚绝句)
- 今天要穿什么颜色(今天要穿什么颜色的衣服最吉利)
- 一道高中题-求杯子的高度(一道高中题-求杯子的高度)
- 网坛停摆三巨头亏损惨重,费德勒跌幅88 纳达少赚2400万(网坛停摆三巨头亏损惨重)
- Beyond 版本《无人深空》主线任务攻略 阿特拉斯之道(版本无人深空主线任务攻略)
热门推荐
- 云主机的优势是什么(云主机有哪些用途和优势)
- Asp.net中params的使用
- dedecms无缩略图怎么设置(dedecmsV5.7版 tag标签长度的修改方法详解)
- linux双网卡热备配置超详细(linux 使用bond实现双网卡绑定单个IP的示例代码)
- 怎么运行xampp中的mysql(本地安装了mysql导致xampp的mysql服务启动失败)
- python数据分析pandas教程(11个Python Pandas小技巧让你的工作更高效附代码实例)
- tftp协议怎么用(tftp服务器有什么用)
- centos7离线安装mysql5.7(CentOS7.5 安装MySql的教程)
- JQuery中extend的用法
- laravel数据库关联查找(laravel 操作数据库常用函数的返回值方法)