List:General Discussion« Previous MessageNext Message »
From:Kapil Karekar Date:April 19 2013 4:49am
Subject:Re: help with mysql db names
View as plain text  
On 19-Apr-2013, at 9:14 AM, Doug <doug@stripped> wrote:

> why these db names created fail but the last one gets success?
> 
> mysql> create database 3208e1c6aa32;
> mysql> create database 208e1c6aa32;
> mysql> create database 08e1c6aa32;
> mysql> create database 8e1c6aa32;

These are not working because MySQL is interpreting the database names as expressions.
Look closely at the db names:

3208e+1
208e+1
08e+1
8e+1

> mysql> create database e1c6aa32;
> Query OK, 1 row affected (0.01 sec)

This works fine.

Suggestion:

Don't use database names starting with integers unless you use back ticks. 

This will work for you: 

mysql> create database `3208e1c6aa32`;

Though I would recommend not using such names. Some poor guy working on your application
six months down the line is going to wonder why his queries are failing, spend a day
trying to figure out and will post the same question again to this list :-)

Cheers!
Kapil Karekar

Managing Director @ Ask DB Experts
http://www.askdbexperts.com

Thread
help with mysql db namesDoug19 Apr
  • Re: help with mysql db namesKeith Keller19 Apr
  • Re: help with mysql db namesKapil Karekar19 Apr
    • Re: help with mysql db namesCarsten Pedersen19 Apr