[1049] Unknown database Hi
When I enter command "php artisan migrate", the issue "[1049] Unknown database" appear, although I put the permission in the environment path in the control panel, so how can I solve it.
check if you've created the database and it matches the configurations in .env file
I did it, but when put the command the issue appear as:
[Illuminate\Database\QueryException]
SQLSTATE[HY000] [1049] Unknown database 'associations' (SQL: select * from information_schema.tables where table_schema = associations and table_name = migration
s)
[PDOException]
SQLSTATE[HY000] [1049] Unknown database 'associations'
because you did not create a database or did not set up correctly in your env file.
This is the config. on (env.) file
DB_CONNECTION=mysql
DB_HOST=127.0.0.1
DB_PORT=3306
DB_DATABASE=associations
DB_USERNAME=root
DB_PASSWORD=
@aeltaib did you create a database called associations??
Issue solved after creating DB command:
mysql -uroot -p
create database [DB name];
use [DB name];
Thanks for ur support
Please can u explain me i have same issue but i don't understand how u solved ? i m getting same error like..
[Illuminate\Database\QueryException]
SQLSTATE[HY000] [1049] Unknown database 'laravel_5' (SQL: select * from information_schema.tab
les where table_schema = laravel_5 and table_name = migrations)
[PDOException]
SQLSTATE[HY000] [1049] Unknown database 'laravel_5'
laravel_5 is my DB name
@mianshargeel
sorry for late answer :)
you just open "cmd" or command prompt & go to your project path then write the commands as:
mysql -uroot -p
then write:
create database [DB name];
then write:
use [DB name];
between [DB name] write your database name, for example:
use association;
'association' here is my database name.
HI, it works, hoever, this does not make us can manage database using mysqlworkbench. I tried it, but i can see, the project on my local does not represent the db on mysql work bench. Any idea?
Please sign in or create an account to participate in this conversation.