I've been using MySQL for database which works as expected but my problem is I'm using 3 machines for my development. I don't want to use any cloud database like AWS MySQL or Google cloud db, because it's a paid one and apparently I'm not online always. Things like I can work even in train (really hardworking right?) wherein internet is superslow.
Now comes SQLite. SQLite is an embedded SQL database engine. Unlike most other SQL databases, SQLite does not have a separate server process. SQLite reads and writes directly to ordinary disk files. A complete SQL database with multiple tables, indices, triggers, and views, is contained in a single disk file. Meaning a portable database which will solve my dillema.
To use SQLite on Laravel
Create a database laravel.sqlite file in the database folder of your laravel project. You might need to download SQLite browser in http://sqlitebrowser.org/
/your-project/database/laravel.sqlite
Open your database.php file in the config folder of your project and make sure what you see in the image below is the same in your project.
'default' => env('DB_CONNECTION', 'sqlite'),
Go to your .env file and and change your DB_CONNECTION to
'sqlite
'. Another thing you have to do is change DB_DATABASE to the path of your laravel.sqlite on your local computer. You can leave the port, username and password.
DB_CONNECTION=sqlite
DB_HOST=127.0.0.1
DB_PORT=3306
DB_DATABASE=D://github/admin-dash/database/laravel.sqlite
DB_USERNAME=root
DB_PASSWORD=
0 comments:
Post a Comment