SQLSTATE[HY000] [1049] Unknown database ‘homestead’

laravel phpmyadmin

SQLSTATE[HY000] [1049] Unknown database ‘homestead’

The laravel error featured above is a simple fix. This error is telling you that there is no database called homestead. You can use PHPMyAdmin to create a database, then try again.

Step 1. Create the Laravel Database

Creating a database for Laravel is pretty simple. I am going to login with PHPMyAdmin and create a database for my Laravel project.

laravel phpmyadmin

Once you are logged in, create a new database by selecting New from the left sidebar (at the top). This will open a page on the right hand side of the page, where you can enter the database name and continue.

create database phpmyadmin

Step 2. Change .env File

Edit your .env file to reflect the name of the database you just created, my database is called myblog as you can see in the image above.

edit .env file

Step 3. Restart the Artisan Server

sudo php artisan serve

Leave a Comment

Your email address will not be published. Required fields are marked *