Laravel Default MySQL Root Password?


I just completed building a Laravel 8 project with MySQL as my database and with Sail/Docker and PhpMyAdmin. This is what I found out what the default username and password is for the default connections. Please note that this was on a development machine in my local envirnment and is recommended to always chance the dafault password.

Laravel 8 Default MySQL password is:

username: root

password: [blank]

Yes, the password is left blank.

you can change the default password in the .env file

DB_CONNECTION=mysql
DB_HOST=mysql
DB_PORT=3306
DB_DATABASE=api5
DB_USERNAME=root
DB_PASSWORD=

Also, look in the config/database.php file:

            'driver' => 'mysql',
            'url' => env('DATABASE_URL'),
            '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', ''),

 NOTE: 2022-12-23T06:26:39.413450Z 6 [Warning] [MY-010453] [Server] root@localhost is created with an empty password ! Please consider switching off the --initialize-insecure option.