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

WordPress Local WordPress Development Local WordPress Development Installing WordPress Locally

What is the point of the database and adding the new user?

I am slightly confused about what setting up the database does. I have noticed that in the video he names the database and site with the same name; however, what does this actually mean practically and what is stored in that new database. So, for example, will I have to make a new database for each site I install? Furthermore, why do we have to add a new user?

1 Answer

Ram Iyer
Ram Iyer
9,116 Points

The database is the place where all of the data pertaining to your website is stored. For simplicity's sake, you can think of it as an Excel sheet that stored a lot of data about your website.

On the backend of any website (WordPress or not) you have a logical language like PHP, Ruby, Python, Java, etc. and a databasing system like MySQL, Postgres, MongoDB, etc. These two are separate from each other in the sense that one stores the data (the database) and the other processes the data (the logical language).

Backend processing is done based on the requests made by users of your website. An example of a request could be as simple as a user coming to your home page. the request he/she is making is for the HTML/CSS/JS of your home page. In order to serve this request, the logical language (PHP in case of WordPress) will 'query' (or extract) data from the database and send it to the user.

A database in WordPress usually uses MySQL and stores a ton of stuff like settings, user details, plugin information, meta data and so on. This is all information that needs to be stored somewhere so that it can be easily accessed later.

Yes, (not sure how it works while using multisite) you will have to make a new database for each website.

Users can be added for multiple reasons. Suppose there are 4 people working on a WordPress website and you dont want each person to have the same privileges. For example you dont want to allow people you just hired a week back to install new plugins or some jazz like that. You can assign them an editor's role which will not give them admin access. Further if you want to track changes made by team mates, then its easier if everyone has a different user account. You might also want to allow people to sign up on your website like how you sign up for other websites, say Facebook. Stuff like that.

Balazs Peak
Balazs Peak
46,160 Points

Thank you Ram! What I'm still struggling to fully understand is that for once, you've said that users need to be added in terms of random people visiting the website. On the other hand, you've said that the actual employees who we hired to manage our website will be the users.

I think the second one is the actual explanation since random visitors of the site do not have to necesseraly sign in (to make those requests). Having a database of visitors and actual database management users (added in phpMyAdmin) are two very much different things. Am I right?

Thank you! Much love!