首页 > 数据库技术 > 详细

删除带中划线的数据库

时间:2020-10-25 17:54:59      阅读:37      评论:0      收藏:0      [点我收藏+]

数据名带了个中划线,删库时报语法错误:

mysql> drop database apigateway-ai;

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 ‘apigateway-ai‘ at line 1

加个单引号,再执行删除命令,仍然不行:

mysql> drop database ‘apigateway-ai‘;

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 ‘‘apigateway-ai‘‘ at line 1

解决:使用反撇号框选数据库名,可以完成命令执行:

mysql> drop database `apigateway-ai`;

Query OK, 77 rows affected (2.38 sec)

结束。

删除带中划线的数据库

原文:https://www.cnblogs.com/liusingbon/p/13873285.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!