indreklasn / laravel-5.4-crud-example

103 stars 48 forks source link

Database configuration #2

Open lokeb opened 6 years ago

lokeb commented 6 years ago

I have never used Laravel, but from the documentation it seems I should be able to set database configuration in config/database.php to sqlite. I have set

'default' => env('DB_CONNECTION', 'sqlite'),

but it still shows this error:

SQLSTATE[HY000] [1045] Access denied for user 'homestead'@'localhost' (using password: YES) (SQL: select * from users)

in Connection.php (line 647)

Seems like it is not taking config/database.php into account at all. How do I fix this?

indreklasn commented 6 years ago

Create a sql database;

MAC:

brew install mysql

mysql -u root -p

create database vaulty;

use database vaulty;

lokeb commented 6 years ago

You did not read my request correctly. It is getting an "Access denied" because it is trying 'homestead' as the user. Can you please tell me how to set the database to sqlite?

indreklasn commented 6 years ago

https://laravel.com/docs/5.5/database explains it way better than I could 😊

lokeb commented 6 years ago

I have followed it, but it is not taking config/database.php into account at all. Here is my database.php. database.php.zip