Answer the question
In order to leave comments, you need to log in
Laravel - when running migrations, it gives an error - Unknown database 'laravel'?
The latest version of Laravel is installed. After the default installation, the data for connecting to the database - 'laravel' - was written in the .env file. Created a new database and changed the data in .env to connect to it:
DB_CONNECTION=mysql
DB_HOST=127.0.0.1
DB_PORT=3306
DB_DATABASE=luxury
DB_USERNAME=luxury
DB_PASSWORD=lluxury
In PHPstorm - the connection is configured - it shows that it is successful. However, after creating migrations and trying to run, it gives an error -
Illuminate\Database\QueryException : SQLSTATE[HY000] [1049] Unknown database 'laravel' (SQL: select * from information_schema.tables where table_schema = laravel and table_name = migrations and table_type = 'BASE TABLE')
Answer the question
In order to leave comments, you need to log in
Most likely the settings were just cached.
Run the following command in the consolephp artisan config:clear
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question