簡體   English   中英

Laravel 6.x 遷移失敗,Maria DB

[英]Laravel 6.x migration failed with Maria DB

最初有一個與 MySQL 一起工作的項目(如果重要的話,5.7.25x64)。 現在我需要在另一台服務器上部署這個項目,使用 MariaDB (10.4.11-MariaDB) 在composer install嘗試php artisan migrate但捕獲異常之后

Illuminate\Database\QueryException  : SQLSTATE[HY000] [2006] MySQL server has gone away (SQL: select * from information_schema.tables where table_schema = admin_testtable and table_name = migrations and table_type = 'BASE TABLE')

拉拉維爾 6.10.1
MariaDB 10.4.11
PHP 7.3.13
Centos8
.env

DB_CONNECTION=mysql
DB_HOST=127.0.0.1
DB_PORT=3306
DB_DATABASE=admin_testtable  //(i can't remove 'admin_' in name. the DB is created and exists)
DB_USERNAME=username
DB_PASSWORD=password

php artisan optimize:clear, php artisan config:cache, composer dump-autoload , 重啟服務器 - 沒有幫助(以防萬一)

編輯您的 my.cnf 文件

max_allowed_packet=64M // set 128M if required

Windows 上,此文件位於:“C:\\ProgramData\\MySQL\\MySQL Server 5.6”

Linux (Ubuntu) 上:/etc/mysql

編輯后重新加載您的 mysql 服務。

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM