I want to create a database which name will have special characters in it. for example, (., - , _, @, #, $, %, &, *)
can anyone provide any output on this?
I would strongly recommend that you do not create databases with such names. But if you absolutely must, here are the restrictions:
To create a database, you can do the following:
mysql> create database `really@strange*database$name`;
Simple: Don't.
You can escape exotic table names using the backtick in mysql, but I don't know if you can use anything inside the backticks. It will give great amounts of pain during the rest of your software life cycle.
I would rather recommend creating another table to hold that exotic names.
-- Example:
CREATE TABLE _DatabaseMetadata (
databaseName VARCHAR(255),
exoticName VARCHAR(255)
) DEFAULT CHARSET=utf8;
Short answer:
Long answer:
SHOW VARIABLES LIKE 'version_compile_os'
to adapt to it). You see - with exotic names it all gets much, much more complicated and in the end it's not really worth it.If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With