Warning: file_get_contents(/data/phpspider/zhask/data//catemap/8/mysql/72.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/5/sql/81.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/ajax/6.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
您的SQL语法有错误;查看与您的MySQL服务器版本对应的手册,以了解使用near'-db';_Mysql_Sql_Mysql Error 1064_Sql Drop - Fatal编程技术网

您的SQL语法有错误;查看与您的MySQL服务器版本对应的手册,以了解使用near'-db';

您的SQL语法有错误;查看与您的MySQL服务器版本对应的手册,以了解使用near'-db';,mysql,sql,mysql-error-1064,sql-drop,Mysql,Sql,Mysql Error 1064,Sql Drop,我试图删除RDS MySQL实例中的一个数据库,但出现以下错误。有人能帮我解决这个问题吗 [ec2-user@ip-10-10-1-14 ~]$ mysql -h wda2d.cmkridjjwpjp.ap-southeast-2.rds.amazonaws.com -u happy-p Enter password: Welcome to the MySQL monitor. Commands end with ; or \g. Your MySQL connection i

我试图删除RDS MySQL实例中的一个数据库,但出现以下错误。有人能帮我解决这个问题吗

  [ec2-user@ip-10-10-1-14 ~]$ mysql -h wda2d.cmkridjjwpjp.ap-southeast-2.rds.amazonaws.com -u happy-p
  Enter password:
  Welcome to the MySQL monitor.  Commands end with ; or \g.
  Your MySQL connection id is 6241
  Server version: 5.6.19-log MySQL Community Server (GPL)

  Copyright (c) 2000, 2014, Oracle and/or its affiliates. All rights reserved.

  Oracle is a registered trademark of Oracle Corporation and/or its
  affiliates. Other names may be trademarks of their respective
  owners.

  Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.

  mysql> show databases;
  +-----------------------+
  | Database              |
  +-----------------------+
  | information_schema    |
  | database              |
  | innodb                |
  | mysql                 |
  | performance_schema    |
  | richard-db            |
  | word-db               |
  | wordpress-db          |
  +-----------------------+
  10 rows in set (0.00 sec)

  mysql> DROP DATABASE wordpress-db;
  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 '-db' at line 1
  mysql> Ctrl-C -- exit!
  Aborted

破折号不是有效的标识符字符,除非将其包装为记号。(否则,它们表示减法的数学运算)


我建议按照最佳做法重命名这些表,并改用下划线。

破折号不是有效的标识符字符,除非用记号将它们括起来。(否则,它们表示减法的数学运算)


我建议按照最佳做法重命名这些表,并改用下划线。

请在drop语句中使用“`QOUTES”尝试您的db名称,请在drop语句中使用“`qoutesmysql>drop数据库“word db”尝试您的db名称;错误1064(42000):您的SQL语法有错误;检查与MySQL服务器版本对应的手册,以了解第1行“word-db”附近使用的正确语法。您使用了单引号而不是勾号。这仍然是不正确的。而且
worddb!=wordpress db
mysql>删除数据库“word db”;错误1064(42000):您的SQL语法有错误;检查与MySQL服务器版本对应的手册,以了解第1行“word-db”附近使用的正确语法。您使用了单引号而不是勾号。这仍然是不正确的。而且
worddb!=wordpress数据库
DROP DATABASE `wordpress-db`;