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 trialSERGIO RODRIGUEZ
17,532 PointsDo I need no create different databases for multiple local WP installs inside the 'sites' folder?
With MAMP we created a database for our localwp.com local site using the phpmyAdmin web software.
Will I have to create another database if I wanted to create another separate project inside the 'sites' folder?
Do I have to use different database names for every project or may I always use 'localwp'?
1 Answer
Kevin Korte
28,149 PointsIt's cleanest to use a fresh local database, and yes it'll have to have a different name.
SERGIO RODRIGUEZ
17,532 PointsSERGIO RODRIGUEZ
17,532 PointsJust to be sure I understand.
I should create a fresh local database with a different name each time I am starting a new local wp project. This means that I shouldn't use the same db for multiple projects.
Is it ok to use the same user for multiple projects?
Thanks
Kevin Korte
28,149 PointsKevin Korte
28,149 PointsCorrect, new local database with each new site. To give you an idea, if you looked at my local phpMyAdmin right now, it has over 15 wordpress databases on it.
Each database needs a unique name. I typically locally anyway name the database the same as the folder name the WP install lives in.
You can however use the same database user if that user has permission to that database. The default root user should have permissions for all databases, and that user can be used for local work.
Don't use the root user for a live site though. It's too easy to hack through. Always a new database user and password when install for live use.