ByteBlog | Bytenaija Blog
Deploying Laravel 5 Applications on Shared Hosting Part 2

Deploying Laravel 5 Applications on Shared Hosting Part 2

In the first part of this post here we successfully published our Laravel 5 application to a shared host. In this post, we will continue with the deployment of our application by migrating our local database to the remote host.

Before we proceed to migrate our database from the local host to the remote host, we first need to create our database on the remote host.

Open your CPanel on the remote host and click on the MySQL Database Wizard. It will prefix your database with your host name. Type in the name of the database and click next step. In the next step, create the database users by entering a username and password and then click on create user. In the next page, assign the user all privileges on the database. Remember the username and password you have created because you will need it in the later.

On your local host, open your phpmyadmin and navigate to your database and click on export. Save the generated sql file. On the CPanel of your remote host click on phpmyadmin navigate to the database you created earlier and click on import, click choose file, navigate to the folder where you save the sql file you exported in you local machine, grab the file and click on import.

This will import the tables you have in your local database to your remote database. If you click on your remote database now, you will see all the tables that were in your local database in your remote database now.

It is time to modify and upload the .env file now with your remote database credentials. Open the .env file, enter the name of the database you created just like the illustration below:

	 DB_CONNECTION=mysql
	DB_HOST=localhost
	DB_PORT=3306
	 DB_DATABASE=database_name
	DB_USERNAME=username
	DB_PASSWORD=password

Once you have done this, you can use an FTP client to upload the .env file to the root of your application as demonstrated in part 1 of this post.

That's all you need to do and hopefully, your tables and database are setup correctly.

If you have any questions or comments, kindly add a comment below and I will get back to you.

Excelsior!

82 Comments

  • Bryon 8 months ago

    Ahaa, its fastidious discussion about this post here at this blog, I have read all that, so now me also commenting here.

    Your method of describing everything in this post is really fastidious, every one can easily be aware of it, Thanks a lot. I’ve been browsing online more than three hours lately, but I never found any attention-grabbing article like yours.

    It’s pretty worth enough for me. In my opinion, if all webmasters and bloggers made just right content as you probably did, the internet can be a lot more helpful than ever before.

    http://foxnews.co.uk/

  • Numbers 8 months ago

    I have been browsing online more than three hours today, yet I never found any interesting article like yours. It is pretty worth enough for me. In my view, if all web owners and bloggers made good content as you did, the internet will be much more useful than ever before.

    Hi there, I log on to your new stuff like every week. Your story-telling style is witty, keep doing what you're doing! It's very easy to find out any topic on web as compared to books, as I found this post at this web site. http://www.cspan.net

  • Caitlin 8 months ago

    I enjoy what you guys are usually up too. Such clever work and reporting! Keep up the great works guys I've added you guys to my personal blogroll. I’ll immediately clutch your rss as I can not in finding your e-mail subscription hyperlink or e-newsletter service. Do you have any? Please permit me understand in order that I may just subscribe. Thanks. I’ve been surfing online more than three hours as of late, yet I by no means discovered any attention-grabbing article like yours. It’s pretty value enough for me. In my view, if all webmasters and bloggers made just right content as you did, the web might be much more useful than ever before. http://www.cspan.net/