Welcome to the Treehouse Community
Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.
Looking to learn something new?
Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.
Start your free trial
Abdulla Alshubbar
31,298 PointsHow to upload shirts4mike to the web ?
Hello,
I was able to finish the shirts4mike project and it works fine on my "localhost" address.
After I uploaded it to the web, I got this message when viewing the website "Could not connect to the database." I'm pretty sure that is because of the credentials for PHPAdmin won't work any more because they were as well on a "localhost" address.
What should I do in order to make it all work again ?
7 Answers
Arthur Verschaeve
20,816 PointsYou have to backup your local database and migrate it to the 'online' one.
You can do that by making a backup of your local one. You have to open your phpMyAdmin local and click 'Export'. Right there choose the SQL format and download the backup.
If your hosting offers phpMyAdmin, open phpMyAdmin and import that file.
Mostly, if your hosting doesn't offer phpMyAdmin it will offer you another service where you can import that backup.
Joel Rivera
29,401 PointsThe migration steps are similar to WordPress Migration from local host to live server so you can follow this track http://teamtreehouse.com/library/local-wordpress-development/local-wordpress-development/migrating-wordpress-from-local-to-live-server
You can also follow the steps in this track which is actually whats recommended by Randy in the track Deploying The Site http://teamtreehouse.com/library/build-a-simple-website#launching-the-website
This is also a goof tool to do a search and replace in your database to change all the references of the localhost url and change it to your new url. This tool is what you would use instead of what's mentioned in the link above since this isn't a wordpress site. https://interconnectit.com/products/search-and-replace-for-wordpress-databases/
Hope this helps.
Abdulla Alshubbar
31,298 PointsThanks for getting back at me guys.
I already have a backup of my database.
I'm not sure about if my hosting offers PHPMyAdmin. The web host I have is "Web Hosting For students" (https://webhostingforstudents.com) that was suggested by Nick Petit.
Arthur Verschaeve
20,816 PointsNot sure, but i think 'Webhosting for students' offers you cPanel. In cPanel you can import your database too.
Abdulla Alshubbar
31,298 PointsThanks. I haven't used cPanel before but i'll give it a try.
Arthur Verschaeve
20,816 PointsThis article can be handy http://www.inmotionhosting.com/support/website/phpmyadmin/import-database-using-phpmyadmin
Abdulla Alshubbar
31,298 PointsI just tried it and it worked.
Thanks a lot guys.