I created a sqlite using vim and it created database.sqlite.swp. Then i configure the .env DB_Connection to sqlite.
Afterwards, I run php artisan serve and php artisan migrate but i got error :
Database (C:Laravel/Project/database/database.sqlite) does not exist.
Vim v8.2
Laravel v4
Please help me :<
You have to create new file in this path (C:Laravel/Project/database/) and name it database.sqlite
Related
I am getting an error when I try to migrate a table from the migration directory to a database.
I want to migrate:
php artisan migrate:rollback --path=/database/migrations/2020_04_17_08144_create_car_production_dates_table.php
But I got this error.
Illuminate\Contracts\Filesystem\FileNotFoundException
File does not exist at path C:\Users\Yared Sisay\OneDrive\Desktop\Laravel\ProjectOne//database/migrations/2020_04_17_08144_create_car_production_dates_table.php.
What about path without /?
php artisan migrate --path=database/migrations/2020_04_17_08144_create_car_production_dates_table.php
Is it possible to create schemas automatically in the database when xampp is turning on? There is no information about it in the Laravel documentation, documentation says only how to do it manually by writing the command php artisan migrate.
Xampp includes a script called apache_startup.bat in the root directory, you can add the following line to it
c:\xampp\php\php.exe -f /path/to/laravel/app/artisan migrate
Then when the apache server starts, it should run that the equivalent of php artisan migrate to setup the database.
You can do php artisan make:migration [migration-name] - other than that, you have to fill the rest yourself.
It is not mentioned in the docs and in the CLI help, it says - Creates the Migration Repository.
What does that mean?
When I run thus command it says - database laravel not found.
Laravel creates a migrations table in your database to keep track of what migrations have already been ran on your database. If you run php artisan migrate:install, this table is created.
This table makes sure that when you run php artisan migrate, migrations that have already been ran on the database are not done again.
When migrating, this table is also created automatically, there is no need to run the install command beforehand.
The reason for your error is probably because you have not set the correct database credentials in either your .env file or config/database.php file.
I install laravel and create project.
I Configed configuration file database and create database in mysql(mysql runnig in wamp server).
I want use migrate for create table in mysql,but i should wait a lot of time and see error.
What shoud i do?
This could help you run these command in terminal:
php artisan migrate --force
The migrate:refresh will roll back all of your migrations then execute the migrate command.this will re-creates your entire database.
php artisan migrate:refresh
This will absolutely help you,run this command:
php artisan migrate:fresh
if it did't help please chick out this:
https://laravel.com/docs/5.7/migrations
Probably you entered your mysql Server credentials in the database config, but you have to edit the .env file. Values in there overwrite config settings.
In my Laravel (5.4) project I want to use sqlite. But when trying to access it I get an "Database does not exist" error.
In my .env file I use
DB_CONNECTION=sqlite
DB_DATABASE=database/easyresults.sqlite
I used touch database/easyresults.sqlite to create the db and successfully ran the migrations using php artisan migrate. But when accessing it using a XMLHTTPRequest, I get the error above.
After changing the path in the .env file to
DB_DATABASE=../database/easyresults.sqlite
I can acces it again, however any command line call doesn't work then.
What am I missing? Does it not work using the .env file? Do I have to use database_path('easyresults.sqlite') and put it directly into config/database.php?
Thanks a lot for your support.
If you want to have the database filename in your .env you can do database_path(env('DB_DATABASE', 'dbfilename')); in your config/database.php
then in your .env you would have
DB_DATABASE=easyresults.sqlite