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 trialVincent Bellittera
20,411 PointsLooking for help setting up my database for wordpress
Hi everyone. I am trying to configure my database for xampp localhost. I get a error that says:
Canβt select database We were able to connect to the database server (which means your username and password is okay) but not able to select the localwp database.
Are you sure it exists? Does the user wpuser have permission to use the localwp database? On some systems the name of your database is prefixed with your username, so it would be like username_localwp. Could that be the problem? If you don't know how to set up a database you should contact your host. If all else fails you may find help at the WordPress Support Forums.
Please help!
9 Answers
Robert Newman
29,571 PointsDid you setup a user for your Database in phpMyAdmin? Try using the username 'root' with no password.
Vincent Bellittera
20,411 Pointsyes I did set up a DB name, user pass. and a table prefix. Should I still try... I was thinking about uninstalling xampp and reinstalling. Maybe I didn't check one of the boxes when I set it up??
I'm gonna try the 'root' with no password now.
Kevin Korte
28,149 PointsMake sure in your phpMyAdmin that your database user you set up has full rights over the database you also set up.
Vincent Bellittera
20,411 PointsMy user has full privileges. Is there somewhere else in phpadmin that I have to go to make sure?
Robert Newman
29,571 PointsIf you go to privileges in phpMyadmin and Add user. In there set your username and set the host to 'localhost' and then a password. Then as Kevin said you need to make sure you set all the privileges for that user.
The username 'root' is the default user already created in phpMyAdmin.
You do not need to reinstall xampp :)
Vincent Bellittera
20,411 PointsYou guys will never believe what I did!!! I put wpuser as the database name,,, so I had to put DB name: wpuser user name: wpuser
LOL
Thanks for the quick responses to my unnecessary question guy's, I really appreciate the help!!
Robert Newman
29,571 PointsHaha glad you sorted it :)
Vincent Bellittera
20,411 PointsIs having the same name for the DB name and username going to conflict with anything... should I change the DB name?
Robert Newman
29,571 PointsYou can change it if you want but in a local environment it really doesn't matter. I would not recommend it in a live version though., lol