mysql报错提示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 ‘‘%expire_logs_days%’’ at line 1

优质老薛主机推荐:15%终身付款折扣:xwseo15 25%首次付款折扣 : xwseo115 点击下图进入购买

今天小魏在操作数据库的时候发现,在用secureCRT登录操作mysql报错提示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 ‘‘%expire_logs_days%’’ at line 1出现这个提示,经过排查发现,这个是语句错误,

报错信息:

mysql报错提示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 ‘‘%expire_logs_days%’’ at line 1

mysql报错提示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 '‘%expire_logs_days%’' at line 1

使用命令:

show variables like ‘%expire_logs_days%’;(小魏在使用反引号的时候出现了报错)

show variables like ‘%expire_logs_days%’;(小魏在用这个命令单引号的时候没有报错,问题解决)

show variables like '%expire_logs_days%';(小魏在用这个命令单引号的时候没有报错,问题解决)

其实这个问题就是语法上的错误,在MySQL中,为了区分MySQL的关键字与普通字符,MySQL引入了一个反引号。

使用的是单引号而不是反引号,所以会就报了这个错误出来。修改后,再次运行就不会报错了。

赞 (42)
分享到:更多 ()