SitePoint Sponsor

User Tag List

Results 1 to 5 of 5
  1. #1
    SitePoint Evangelist TomTees's Avatar
    Join Date
    Apr 2010
    Location
    Iowa
    Posts
    553
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Naming Conventions

    Is it okay to start a Database name with an underscore?

    For example...

    _MyDatabase

    TomTees

  2. #2
    SQL Consultant gold trophysilver trophybronze trophy
    r937's Avatar
    Join Date
    Jul 2002
    Location
    Toronto, Canada
    Posts
    39,270
    Mentioned
    60 Post(s)
    Tagged
    3 Thread(s)
    if you're asking whether mysql will object to it, i will leave it up to you to test it

    here ya go, just run this --
    Code:
    CREATE DATABASE _StartsWithUnderscore
    so, what did you get?

    but if you're asking whether it's a good convention or not, let me ask you -- why would you want to do that?
    rudy.ca | @rudydotca
    Buy my SitePoint book: Simply SQL
    "giving out my real stuffs"

  3. #3
    SitePoint Evangelist TomTees's Avatar
    Join Date
    Apr 2010
    Location
    Iowa
    Posts
    553
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by r937 View Post
    if you're asking whether mysql will object to it, i will leave it up to you to test it

    here ya go, just run this --
    Code:
    CREATE DATABASE _StartsWithUnderscore
    so, what did you get?
    Just because something works doesn't mean it won't blow up later.

    (Try draining the oil out of your car. Just because you can start it up and make it out of your driveway or to the end of the block doesn't mean you'd make it to the store and back...)


    but if you're asking whether it's a good convention or not, let me ask you -- why would you want to do that?
    Because I have several test databases in phpMyAdmin, and I wanted to sort this new database to the top for organizational purposes. (I'm an organization freak.)

    I would not do that for a production database, but it would be easier on my eyes during development.


    TomTees

  4. #4
    SQL Consultant gold trophysilver trophybronze trophy
    r937's Avatar
    Join Date
    Jul 2002
    Location
    Toronto, Canada
    Posts
    39,270
    Mentioned
    60 Post(s)
    Tagged
    3 Thread(s)
    ah, okay, well, in that case, go right ahead

    p.s. for your future reference, i do not have a car, i walk to the store
    rudy.ca | @rudydotca
    Buy my SitePoint book: Simply SQL
    "giving out my real stuffs"

  5. #5
    SitePoint Evangelist TomTees's Avatar
    Join Date
    Apr 2010
    Location
    Iowa
    Posts
    553
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by r937 View Post
    ah, okay, well, in that case, go right ahead
    Cool.


    p.s. for your future reference, i do not have a car, i walk to the store
    Then for your future reference, you shouldn't need to any motor oil in order to go to the store!

    (Unless, of course, you've ever watched the movie "Police Academy"...)


    TomTees


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •