本文共 612 字,大约阅读时间需要 2 分钟。
在mysql中创建纯数字数据库是不合标准的,默认会提示语法错误,但通过mysql转义符 ` 还是可以创建。
CREATE DATABASE 222;
报错:
You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '222' at line 1
# 加上转义符
CREATE DATABASE `222`;
成功。
# 查询语句
SELECT * FROM 222.aaa WHERE id = 1;
报错:
错误码: 1064
You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '222.aaa WHERE id = 1' at line 1
# 加上转义符查询
SELECT * FROM `222`.aaa WHERE id = 1;
可以查询
# 删除加转义符删除
DROP DATABASE `222`;
专注于 服务器运维与web架构
E-mail:venus#rootop.org
转载地址:http://pwyhp.baihongyu.com/