PHP Artisan Migrate Error

Asked

Viewed 674 times

0

I am having the following error while executing the command.

In Connection.php line 647:

SQLSTATE[HY000] [1049] Unknown database 'localhost' (SQL: select * from information_schema.Tables Where table_schem a = localhost and table_name = Migrations)

In Connector.php line 68:

SQLSTATE[HY000] [1049] Unknown database 'localhost'

  • 3

    You have already modified the file .env? Because he’s saying that the database called localhost is unknown

1 answer

1

Your configuration file .env is configured incorrectly, in the parameter where the name of your database should be, it is configured as localhost your file in the configuration part of the database parameters should look like this:

DB_CONNECTION=mysql
DB_HOST=localhost
DB_PORT=3306
DB_DATABASE= nome_base*
DB_USERNAME= root(ou seu user local)*
DB_PASSWORD= senha*

Browser other questions tagged

You are not signed in. Login or sign up in order to post.