当前位置:Gxlcms > 数据库问题 > mysql5.7基础 create database... 创建的数据库的名字是 关键字、特殊字符,用反引号

mysql5.7基础 create database... 创建的数据库的名字是 关键字、特殊字符,用反引号

时间:2021-07-01 10:21:17 帮助过:3人阅读

create database database; ERROR 1064 (42000): 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 datab ase at line 1
mysql> create database @@@@;
ERROR 1064 (42000): 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 @@@@
 at line 1

 

 

正确的代码及效果

mysql> create database `database`;
Query OK, 1 row affected (0.00 sec)

mysql> show databases;
+--------------------+
| Database           |
+--------------------+
| information_schema |
| database           |
| mysql              |
| newbases           |
| performance_schema |
| test               |
+--------------------+
6 rows in set (0.00 sec)

mysql>

 

mysql> create database `@@@@`;
Query OK, 1 row affected (0.03 sec)

mysql> show databases;
+--------------------+
| Database           |
+--------------------+
| information_schema |
| @@@@               |
| database           |
| mysql              |
| newbases           |
| performance_schema |
| test               |
+--------------------+
7 rows in set (0.00 sec)

mysql>

  

  


mysql,关系型数据库管理系统,优秀,值得学习。
学习资源:itcast和itheima视频库 + 清净的心地。
如果您有公开的资源,可以分享给我的话,用您的资源学习也可以。
博文是观看视频后,融入思考写成的。博文好,是老师讲得好。博文坏,是 给最苦 没认真。

mysql5.7基础 create database... 创建的数据库的名字是 关键字、特殊字符,用反引号

标签:sch   weight   col   orm   win   gpo   创建   ima   管理   

人气教程排行