How do you create a database with a dash in the name?

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Phil Powell

    #1

    How do you create a database with a dash in the name?

    I have a client database in my db dev server environment I need to
    create, but the client name contains a dash "-". This blows up upon
    attempting to do

    create database my-site;

    How then do I create this database, simple as that?

    Thanx
    Phil
  • Jeffrey Silverman

    #2
    Re: How do you create a database with a dash in the name?

    On Thu, 29 Jan 2004 09:54:11 -0800, Phil Powell wrote:
    [color=blue]
    > I have a client database in my db dev server environment I need to create,
    > but the client name contains a dash "-". This blows up upon attempting to
    > do
    >
    > create database my-site;
    >
    > How then do I create this database, simple as that?
    >
    > Thanx
    > Phil[/color]

    More information needed:

    What database server are you using? (Assuming MySQL but you never know...)

    --
    Jeffrey D. Silverman | jeffrey AT jhu DOT edu
    Website | http://www.wse.jhu.edu/newtnotes/

    Comment

    • SEO koivi

      #3
      Re: How do you create a database with a dash in the name?

      Phil Powell wrote:[color=blue]
      > I have a client database in my db dev server environment I need to
      > create, but the client name contains a dash "-". This blows up upon
      > attempting to do
      >
      > create database my-site;[/color]

      If you are using MySQL, use:
      create database `my-site`;

      --
      Justin Koivisto - spam@koivi.com
      PHP POSTERS: Please use comp.lang.php for PHP related questions,
      alt.php* groups are not recommended.
      Official Google SERPs SEO Competition: http://www.koivi.com/serps.php

      Comment

      • Jeffrey Silverman

        #4
        Re: How do you create a database with a dash in the name?

        On Thu, 29 Jan 2004 09:54:11 -0800, Phil Powell wrote:
        [color=blue]
        > I have a client database in my db dev server environment I need to create,
        > but the client name contains a dash "-". This blows up upon attempting to
        > do
        >
        > create database my-site;
        >
        > How then do I create this database, simple as that?
        >
        > Thanx
        > Phil[/color]

        Assuming you mean MySQL...

        More info:
        http://www.mysql.com/doc/en/Legal_names.html

        What difference does it make to not use a hyphen? I mean, if the client
        *wants* it that way is one thing, but databases are very "back end" and
        may not ever be actually seen by the client. Just omit the hyphen is my
        suggestion.

        --
        Jeffrey D. Silverman | jeffrey AT jhu DOT edu
        Website | http://www.wse.jhu.edu/newtnotes/

        Comment

        • Shawn

          #5
          Re: How do you create a database with a dash in the name?


          "Phil Powell" <soazine@erols. com> wrote in message
          news:1cdca2a7.0 401290954.7aa24 fd9@posting.goo gle.com...[color=blue]
          > I have a client database in my db dev server environment I need to
          > create, but the client name contains a dash "-". This blows up upon
          > attempting to do
          >
          > create database my-site;
          >
          > How then do I create this database, simple as that?
          >
          > Thanx
          > Phil[/color]

          It may be like my server. I use CPanel and it appends the domainname to the
          beginning of all databases created. e.g. domain_database .

          So I would have to create a similar script to cause PHP to create a database
          that added the underscore to the name with my domain before the underscore
          on any db that I created.


          Comment

          • Phil Powell

            #6
            Re: How do you create a database with a dash in the name?

            "Shawn" <shawn@tsorland o.com> wrote in message news:<WfsTb.111 76$aU6.1949@big news3.bellsouth .net>...[color=blue]
            > "Phil Powell" <soazine@erols. com> wrote in message
            > news:1cdca2a7.0 401290954.7aa24 fd9@posting.goo gle.com...[color=green]
            > > I have a client database in my db dev server environment I need to
            > > create, but the client name contains a dash "-". This blows up upon
            > > attempting to do
            > >
            > > create database my-site;
            > >
            > > How then do I create this database, simple as that?
            > >
            > > Thanx
            > > Phil[/color]
            >
            > It may be like my server. I use CPanel and it appends the domainname to the
            > beginning of all databases created. e.g. domain_database .
            >
            > So I would have to create a similar script to cause PHP to create a database
            > that added the underscore to the name with my domain before the underscore
            > on any db that I created.[/color]


            Actually I can't create any database much less a mySQL database with a
            dash in it, so I gave up and had the sys admin literally make it for
            me, with an underscore.

            Phil

            Comment

            Working...