By Mistake My mac got shutdown and when i opened it the database was gone from phpmyadmin I have tried php artisan migrate it throws following error
No such file or directory (SQL: select * from information_schema.tables where table_schema = phpdemo and table_name = migrations).
I tried replacing localhost from 127.0.0.1 at DB_HOST in .env file . but no luck I am using xampp , php version 7.2.7
Please help me
firstly you need to check if the mysql service is running, i find this How to check if MySQL server is working or not?
sudo service mysql status
then, check the .env file, and check if the database is created, if not, you can create it and then run
php artisan migrate
If still not working, maybe you'll need to add manually the migrations table, and all the data, that table ony have 3 columns: id, migration, batch (in my case, laravel 5.5), the id is an autoincrements, the migrations has the name of the migration file(for example 2014_10_12_000000_create_users_table) and all the batch columns in my projects has the 1
I think you can try manually create empty database with name phpdemo
and then run php artisan migrate
again