Does MySQL allows to create database with dot?

You can't use the dot in a database name. Also, I'd avoid using it in any identifier. A common convention is to use underscore instead. It will serve the same purpose and will avoid a LOT of confusion. If you do have a good reason for using strange and otherwise-illegal characters in a table or field name, then you have to escape it.

to escape identifiers in MySQL, use the backtick:

SELECT `select`, `some.field name`, `crazy()naming+here`
FROM `my-=+table`

Getting into the habit of backticking all field names regardless of whether you need to is a good practice in my opinion, but that's another story.


You can use . in names from MySQL 5.1.6 according to the documentation.

However, as has been said and will said again, please don't do it. For every problem you think you're solving now you'll be creating five which will bite you later on. Since . is used to qualify names - e.g. database.table or table.column you'll have to quote your database name every time you use it.*

You can do this with backticks:

CREATE TABLE `do.not.do.this` (col INT);

or using double quotes if you set the following option:

SET sql_mode='ANSI_QUOTES';
CREATE TABLE "asking.for.problems" (col INT);

* Not strictly true - you have to quote any character that's not alphanumeric or _ or $ , but . is a particularly troublesome option to have in your names.