2

Originally had a project that worked with MySQL(5.7.25x64 if it matters). Now I need to deploy this project on another server, with MariaDB (10.4.11-MariaDB) After composer install trying php artisan migrate but catch exception

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')

laravel 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, restart server - doesn't help (just in case)

Tig
  • 38
  • 4
  • Check your engine – Kumar Praveen Jan 09 '20 at 13:41
  • see https://laravel-news.com/laravel-and-mysql-8-fixing-mysql-server-has-gone-away-error – Salman Zafar Jan 09 '20 at 13:42
  • can you please try this, in your config > database.php for `'prefix' => 'admin_',` try adding admin_ and leave value `DB_DATABASE=testtable` also confirm username and password as well, check this thread https://stackoverflow.com/q/35036547/4650866 – Vipertecpro Jan 14 '20 at 05:11

1 Answers1

1

Edit your my.cnf file

max_allowed_packet=64M // set 128M if required

On Windows this file is located at: "C:\ProgramData\MySQL\MySQL Server 5.6"

On Linux (Ubuntu): /etc/mysql

Reload your mysql service after editing.

fahim152
  • 2,531
  • 1
  • 10
  • 29