ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that corresponds to your
Posted trp
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that corresponds to your 相关的知识,希望对你有一定的参考价值。
create table fina_indicator(
ts_code varchar(20) comment ‘TS代码‘,
ann_date date comment ‘公告日期‘,
end_date date comment ‘报告期‘,
.....
报错信息: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 ‘ts_code varchar(20)comment‘TS代码‘, ann_datedatecomment‘公告日期‘, end_dat‘ at line 1
在终端下进入mysql创建表时报错
但在Mysql workbench里创建不报错
引号应该有正确的写法;
参见下文:
https://www.jianshu.com/p/a0e6f1e1ac73
在MySQL命令行使用sql语句进行建表时,MySQL 报错,遇到同一个问题,写一篇博客来加深印象。
原SQL语句:
CREATE DATABASE ‘xiaoyaoji‘ CHARACTER SET utf8;
咋一看没有问题,但是运行起来就会曝出以下问题:
这个问题是语法上的错误,在MySQL中,为了区分MySQL的关键字与普通字符,MySQL引入了一个反引号。
在上述的sql语句中,数据库名称使用的是单引号而不是反引号,所以会就报了这个错误出来。修改后为:
CREATE DATABASE `xiaoyaoji` CHARACTER SET utf8;`
在英文键盘输入环境下,按图示按钮输入反引号 `
以上是关于ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that corresponds to your 的主要内容,如果未能解决你的问题,请参考以下文章
解决mysql 8报错 ERROR 1064 (42000): You have an error in your SQL syntax
解决mysql 8报错 ERROR 1064 (42000): You have an error in your SQL syntax
ERROR 1064 (42000): You have an error in your SQL syntax; check the manual ...
解决——》ERROR 1064 (42000)You have an error in your SQL syntax; check the manual that corresponds
ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that corresponds to your
ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that corresponds to your