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 trialMichael Zeta
18,135 PointsCan't select database
There is no explanation in the video about how to create a wordpress database when using Xampp. I'm sure that is the reason for getting the following error when trying to install wordpress locally...
"We were able to connect to the database server (which means your username and password is okay) but not able to select the wp_portfolio database.
Are you sure it exists? Does the user root have permission to use the wp_portfolio database? On some systems the name of your database is prefixed with your username, so it would be like username_wp_portfolio. Could that be the problem?"
Any advice is very appreciated.
2 Answers
Darren Healy
Front End Web Development Techdegree Student 23,565 PointsThis will help as a start: http://teamtreehouse.com/library/local-wordpress-development/local-wordpress-development/installing-a-local-web-server-on-a-pc
Then, when you think you are at the stage of creating a database. Run Xampp with administrator rights, start Apache and MySQL, then click on the MySQL admin button which will bring up the PHPmyadmin view. This is set up in the same way as it is in the Mamp videos.
This is definitely covered as I've just learned it myself last week and have reviewed the section several times to make sure I'm doing it right.
Hope I've helped!
Emeka Okoye
2,489 PointsTo install WP locally using Xampp, first create your database using PHPMyAdmin. You can call your database anything you like...
When you run the installation in the browser, enter the database name you created, for the username enter 'root', leave the password blank and accept the other defaults.
In the end your config.php should look like this:
/** The name of the database for WordPress */
define('DB_NAME', 'Database name here');
/** MySQL database username */
define('DB_USER', 'root');
/** MySQL database password */
define('DB_PASSWORD', '');
/** MySQL hostname */
define('DB_HOST', 'localhost');
I hope I've answered your question, if not let me know.
Craig Watson
27,930 PointsCraig Watson
27,930 PointsHi Michael,
It would be up to you but because of the differences between installing on a mac and installing on a windows (im on windows) I wrote a quick PDF I could send you it has a full walk through of the process needed to get wordpress installed locally and up and running with database's and users.
Also handy to have for reference to,
Let me know if you do!
Thanks