wafi
wafi

Reputation: 78

sqlite connection uses username and password

The MySQLite connection uses a username and password but I didn't specify any

Illuminate\Database\QueryException SQLSTATE[HY000] [1045] Access denied for user 'homestead'@'localhost' (using password: YES) (SQL: select * from customers)

Upvotes: 1

Views: 499

Answers (1)

Udhav Sarvaiya
Udhav Sarvaiya

Reputation: 10071

This error basically comes from changing the DB_DATABASE, DB_USERNAME and DB_PASSWORD in .env file

Open the .env file and edit it.

DB_CONNECTION=sqlite
DB_HOST=127.0.0.1
DB_PORT=3306
DB_DATABASE=            // Your Database Name
DB_USERNAME=           // Your Database Username
DB_PASSWORD=          // Your Database Password

The DB_USERNAME should be set to root if you do not have a default username in the installation time.

NOTE: If no password is set on the database, clear it DB_PASSWORD,

After .env edit, must be clear cache:

php artisan config:cache

Upvotes: 2

Related Questions