471,337 Members | 1,121 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 471,337 software developers and data experts.

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
Jul 17 '05 #1
5 2311
On Thu, 29 Jan 2004 09:54:11 -0800, Phil Powell wrote:
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


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/

Jul 17 '05 #2
Phil Powell wrote:
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;


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

--
Justin Koivisto - sp**@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
Jul 17 '05 #3
On Thu, 29 Jan 2004 09:54:11 -0800, Phil Powell wrote:
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


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/

Jul 17 '05 #4

"Phil Powell" <so*****@erols.com> wrote in message
news:1c**************************@posting.google.c om...
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


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.
Jul 17 '05 #5
"Shawn" <sh***@tsorlando.com> wrote in message news:<Wf******************@bignews3.bellsouth.net> ...
"Phil Powell" <so*****@erols.com> wrote in message
news:1c**************************@posting.google.c om...
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


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.

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
Jul 17 '05 #6

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

2 posts views Thread by Robert | last post: by
1 post views Thread by el_roachmeister | last post: by
reply views Thread by Darin Browne | last post: by
1 post views Thread by mats.broberg | last post: by
reply views Thread by =?ISO-8859-1?Q?=22Martin_v=2E_L=F6wis=22?= | last post: by

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.