Welcome to ShenZhenJia Knowledge Sharing Community for programmer and developer-Open, Learning and Share
menu search
person
Welcome To Ask or Share your Answers For Others

Categories

I am having some errors with laravels php artisan migrate command, when I try to migrate, it keeps throwing errors saying, unknown database 'database name' I have checked my database configure file and even copied to a different project and it works perfectly there, I have tried composer dump-autoload command but that didn't solve the problem either. Please I will really appreciate if someone helps, since this is a new project and can't afford to lose even a minute to my deadline, thanks in advance!

The command I run from the terminal while I have CD'ed into the project folder is.

php artisan migrate

This is the error I get.

[PDOException]
SQLSTATE[42000] [1049] Unknown database '[gicfamily4]'
See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
thumb_up_alt 0 like thumb_down_alt 0 dislike
206 views
Welcome To Ask or Share your Answers For Others

1 Answer

[PDOException]
SQLSTATE[42000] [1049] Unknown database '[gicfamily4]'

This is a MySQL error and is indicative of either a misconfiguration in your environment's database.php config file (misspelling in the database name) or the database gicfamily4 simply doesn't exist on the database server you are connecting to.

Verify your connection information again. If possible, try to attempt to connect to the mysql server from the command line using the exact same information contained in your database.php file (via copy and paste):

$ mysql -u <username from database.php file> -p -h <database host from database.phpfile>
Enter Password: <paste password from database.php file>

mysql> use gicfamily4;

I suspect you will get the exact same error as above.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
thumb_up_alt 0 like thumb_down_alt 0 dislike
Welcome to ShenZhenJia Knowledge Sharing Community for programmer and developer-Open, Learning and Share
...