是否存在“不允许”字符列表mysql表的列名? [英] Is there a "not allowed" character list for mysql table's column names?

查看:225
本文介绍了是否存在“不允许”字符列表mysql表的列名?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在google上找不到任何东西,也许我没有搜寻正确的字词。
但是在mysql数据库中有不允许的字符列表的列名吗?我对 $ 符号特别感兴趣。

解决方案

MySQL docs 假设您至少使用MySQL 5.0或更高版本:



标识符中允许的字符:




  • ASCII: 0-9,az,AZ $ _](基本拉丁字母,数字0-9,美元,下划线)


  • 扩展:U + 0080 .. U + FFFF

    标识符中允许的字符包括完整的Unicode基本多语言平面(BMP) ),除了U + 0000:




    • ASCII:U + 0001 .. U + 007F


    • 扩展:U + 0080 .. U + FFFF




    TL



    回答您的问题,可以。您可以在引用或不引用的列名称中使用 $ p>

    I couldn't find anything on google, maybe I am not searching the correct term. But is there a list of not allowed character for column names in mysql database ? I am particularly interested in the $ sign.

    解决方案

    Extracted from the MySQL docs assuming you are using at least MySQL 5.0 or higher:

    Permitted characters in unquoted identifiers:

    • ASCII: [0-9,a-z,A-Z$_] (basic Latin letters, digits 0-9, dollar, underscore)

    • Extended: U+0080 .. U+FFFF

    Permitted characters in quoted identifiers include the full Unicode Basic Multilingual Plane (BMP), except U+0000:

    • ASCII: U+0001 .. U+007F

    • Extended: U+0080 .. U+FFFF

    TL;DR

    Answering your question, yes.. You can use the $ character in column names quoted or unquoted.

    这篇关于是否存在“不允许”字符列表mysql表的列名?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆