欧美bbbwbbbw肥妇,免费乱码人妻系列日韩,一级黄片

laravel執(zhí)行php artisan migrate報錯的解決方法

 更新時間:2019年10月09日 09:50:59   作者:_吳慧良  
今天小編就為大家分享一篇laravel執(zhí)行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 擴(kuò)展"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.

數(shù)據(jù)庫編碼改為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執(zhí)行php artisan migrate報錯的解決方法就是小編分享給大家的全部內(nèi)容了,希望能給大家一個參考,也希望大家多多支持腳本之家。

相關(guān)文章

  • php 陰歷-農(nóng)歷-轉(zhuǎn)換類代碼

    php 陰歷-農(nóng)歷-轉(zhuǎn)換類代碼

    網(wǎng)上GOOGLE到的,非常不錯 來源不祥 非本人所寫,需要的朋友可以參考下。
    2012-01-01
  • php批量修改表結(jié)構(gòu)實(shí)例

    php批量修改表結(jié)構(gòu)實(shí)例

    下面小編就為大家?guī)硪黄猵hp批量修改表結(jié)構(gòu)實(shí)例。小編覺得挺不錯的,現(xiàn)在就分享給大家,也給大家做個參考。一起跟隨小編過來看看吧
    2017-05-05
  • thinkphp中ajax與php響應(yīng)過程詳解

    thinkphp中ajax與php響應(yīng)過程詳解

    這篇文章主要介紹了thinkphp中ajax與php響應(yīng)過程,以實(shí)例形式詳細(xì)分析了ThinkPHP框架中Ajax響應(yīng)方式的處理原理及實(shí)現(xiàn)過程,非常具有實(shí)用價值,需要的朋友可以參考下
    2014-12-12
  • thinkPHP5.0框架獨(dú)立配置與動態(tài)配置方法

    thinkPHP5.0框架獨(dú)立配置與動態(tài)配置方法

    這篇文章主要介紹了thinkPHP5.0框架獨(dú)立配置與動態(tài)配置方法,結(jié)合實(shí)例形式分析了thinkPHP5.0框架獨(dú)立配置與靜態(tài)配置的功能、實(shí)現(xiàn)技巧與相關(guān)注意事項,需要的朋友可以參考下
    2017-03-03
  • laravel修改用戶模塊的密碼驗證實(shí)現(xiàn)

    laravel修改用戶模塊的密碼驗證實(shí)現(xiàn)

    本文主要介紹了laravel修改用戶模塊的密碼驗證實(shí)現(xiàn),文中通過示例代碼介紹的非常詳細(xì),具有一定的參考價值,感興趣的小伙伴們可以參考一下
    2021-09-09
  • php遠(yuǎn)程請求CURL實(shí)例教程(爬蟲、保存登錄狀態(tài))

    php遠(yuǎn)程請求CURL實(shí)例教程(爬蟲、保存登錄狀態(tài))

    這篇文章主要給大家介紹了關(guān)于php遠(yuǎn)程請求CURL(爬蟲、保存登錄狀態(tài))的相關(guān)資料,文中通過示例代碼介紹的非常詳細(xì),對大家的學(xué)習(xí)或者工作具有一定的參考學(xué)習(xí)價值,需要的朋友們下面隨著小編來一起學(xué)習(xí)學(xué)習(xí)吧
    2020-12-12
  • PHP錯誤處理函數(shù)register_shutdown_function使用示例

    PHP錯誤處理函數(shù)register_shutdown_function使用示例

    這篇文章主要介紹了PHP錯誤處理函數(shù)register_shutdown_function使用示例,需要的朋友可以參考下
    2017-07-07
  • PHP中比較時間大小實(shí)例

    PHP中比較時間大小實(shí)例

    這篇文章主要介紹了PHP中比較時間大小實(shí)例,可能是最基礎(chǔ)的寫法了,直接用運(yùn)算符比較,需要的朋友可以參考下
    2014-08-08
  • PHP面向?qū)ο蠼坛讨远x類

    PHP面向?qū)ο蠼坛讨远x類

    所謂面向?qū)ο缶褪鞘裁磿r候什么東西做什么,我們設(shè)計類的時候需要想的就是怎么做的內(nèi)容,那么怎么樣的一個類才算是符合OOP的思想呢,答案是:這個類寫好之后,在使用的過程中,能準(zhǔn)確的代表一個事物,在書寫的時候代碼要和思維描述一致,即這個東西做什么。
    2014-06-06
  • Yii2實(shí)現(xiàn)讓關(guān)聯(lián)字段支持搜索功能的方法

    Yii2實(shí)現(xiàn)讓關(guān)聯(lián)字段支持搜索功能的方法

    這篇文章主要介紹了Yii2實(shí)現(xiàn)讓關(guān)聯(lián)字段支持搜索功能的方法,結(jié)合實(shí)例形式分析了Yii2關(guān)聯(lián)字段搜索功能的原理與相關(guān)實(shí)現(xiàn)技巧,需要的朋友可以參考下
    2016-08-08

最新評論