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 Migrating WordPress from Local to Live Server

Gina Bégin
PLUS
Gina Bégin
Courses Plus Student 8,613 Points

mySQL Database Username doesn't have a "_" before it.. is that okay?

In the demo, Zac shows that when creating a new username in the mySQLWizard database, there's an underscore before the name he types in. Mine doesn't have that (I'm in Godaddy). Does this matter?

3 Answers

Chris Shaw
Chris Shaw
26,676 Points

Hi Gina,

The underscore dictates namespaces which is a very relaxed convention as it's optional whenever using MySQL servers, essentially for Zac his hosting username would be used as the namespace allowing his databases to be grouped together instead of separated out.

For example if my username was chris and I used a cPanel type control panel I would see databases created in the following fashion.

chris_
  database_one
  database_two
  database_three

Now remember as I said this is a very relaxed convention and you don't have to use it but if you say had a website with different software running under the same domain you would generally use the name of the domain followed by the database, for example if your domain is example.com you would do something like.

example_
  database_one
  database_two
  database_three

another_domain_
  database_one
  database_two
  database_three
But what good does this do?

If you ever find yourself with a list of cluttered database names namespacing them fixes the overall issue of clutter and allowing better visibility, I always use this convention whether or not it's just going to be a single database as it's just easier to manage in the long run.

Hope that helps.

You don't need to make a database with the same way. As long as it functions it is all right :)

Gina Bégin
PLUS
Gina Bégin
Courses Plus Student 8,613 Points

Thank you all. I'm not quite sure I understand all of that yet, Chris, but I am sure I will as time goes on and will use it to refer back to. :)

Gloria, thanks for confirming, too!

You are welcome