I’m trying to use xampp for my sql server, everything works fine on that part (I can access phpmyadmin, create my db, etc). However, when I run the command "php artisan migrate" it always says te following error:
IlluminateDatabaseQueryException
SQLSTATE[HY000] [1049] Unknown database 'inverdana' (SQL: select * from information_schema.tables where table_schema = inverdana and table_name = migrations and table_type = 'BASE TABLE')
I have tried clearing cache, restarting the laravel server, modifying the .env file to use the address XAMPP gives, but nothing works.
It’s really frustrating that laravel doesn’t gives more clues on what’s failing.
4
Answers
It turned out to be the operating system (I'm using MacOS). In case someone else is facing the same problem you might want to try what helped me.
The problem was that I had installed mysql and apache from my terminal. This caused that XAMPP wasn't able to initialize properly and didn't share the proper ports, therefore, my Laravel application could never find the right database. So I uninstalled both mysql, apache and I reinstalled XAMPP (version 7.4.5).
After that, everything worked properly.
Another Issue could be that your configurations are already cached and saved in
/bootstrap/cache/config.php
file. You just need to delete this file and your problem is sorted.if you want them to be cached again then run
command
In my case,
Try this,
This command will clear all kinds of cache at once. :
This is an alias of :
Is it possible to use the code below with the new clear cache commands: