SQLSTATE[HY000] [2054] Server sent charset unknown to the client

Posted 1 month ago by andreixfr

I am trying to use my database again.Last night, php artisan migrate worked for me, but now I got some weird errors.Name of my table is andrei_db, name root.

In Connection.php line 647:

  SQLSTATE[HY000] [2054] Server sent charset unknown to the client. Please, report to the developers (SQL: select * from information_schema.tables where  
   table_schema = andrei_db and table_name = migrations)

In Connector.php line 68:

  SQLSTATE[HY000] [2054] Server sent charset unknown to the client. Please, report to the developers

In Connector.php line 68:

  PDO::__construct(): Server sent charset (255) unknown to the client. Please, report to the developers 

What I've tried :

1.Add this code to my my.cnf file but it has no response.

[client]
default-character-set=utf8

[mysql]
default-character-set=utf8


[mysqld]
collation-server = utf8_unicode_ci
character-set-server = utf8

My database.php

    'sqlite' => [
        'driver' => 'sqlite',
        'database' => env('DB_DATABASE', database_path('database.sqlite')),
        'prefix' => '',
    ],

    'mysql' => [
        'driver' => 'mysql',
        'host' => env('DB_HOST', '127.0.0.1'),
        'port' => env('DB_PORT', '3306'),
        'database' => env('DB_DATABASE', 'forge'),
        'username' => env('DB_USERNAME', 'forge'),
        'password' => env('DB_PASSWORD', ''),
        'unix_socket' => env('DB_SOCKET', ''),
        'charset' => 'utf8mb4',
        'collation' => 'utf8mb4_unicode_ci',
        'prefix' => '',
        'strict' => true,
        'engine' => null,
    ],

My env file

DB_CONNECTION=mysql
DB_HOST=127.0.01
DB_PORT=3306
DB_DATABASE=root
DB_USERNAME=root
DB_PASSWORD=here_is_my_password

Any tips?

Please sign in or create an account to participate in this conversation.