Mysql Create Database with special characters in the name

前端 未结 3 663
猫巷女王i
猫巷女王i 2020-12-28 17:06

I want to create a database which name will have special characters in it. for example, (., - , _, @, #, $, %, &, *)

can anyone provide any output on this?

3条回答
  •  天涯浪人
    2020-12-28 17:52

    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;
    

提交回复
热议问题