qq_19248001 2017-09-01 19:49 采纳率: 0%
浏览 1057
已结题

sql语句报错,请大神看下哪里的错误

错误信息:
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 'DEFAULT CHARSET=utf8' at line 1
CREATE TABLE ysxz_ad ( id int(10) unsigned NOT NULL AUTO_INCREMENT, title varchar(100) NOT NULL DEFAULT '', classid tinyint(1) unsigned NOT NULL DEFAULT '0', hits int(10) unsigned NOT NULL DEFAULT '0', addtime int(10) unsigned NOT NULL DEFAULT '0', updatetime int(10) unsigned NOT NULL DEFAULT '0', image_src varchar(255) NOT NULL DEFAULT '', image_url varchar(255) NOT NULL DEFAULT '', image_alt varchar(100) NOT NULL DEFAULT '', order smallint(4) unsigned NOT NULL DEFAULT '0', status tinyint(1) unsigned NOT NULL DEFAULT '0', PRIMARY KEY (id)) ENGINE=MyISAM AUTO_INCREMENT=15 DEFAULT CHARSET=utf8

数据库

DROP TABLE IF EXISTS {dbprefix}ad;
CREATE TABLE {dbprefix}ad (
id int(10) unsigned NOT NULL AUTO_INCREMENT,
title varchar(100) NOT NULL DEFAULT '',
classid tinyint(1) unsigned NOT NULL DEFAULT '0',
hits int(10) unsigned NOT NULL DEFAULT '0',
addtime int(10) unsigned NOT NULL DEFAULT '0',
updatetime int(10) unsigned NOT NULL DEFAULT '0',
image_src varchar(255) NOT NULL DEFAULT '',
image_url varchar(255) NOT NULL DEFAULT '',
image_alt varchar(100) NOT NULL DEFAULT '',
order smallint(4) unsigned NOT NULL DEFAULT '0',
status tinyint(1) unsigned NOT NULL DEFAULT '0',
PRIMARY KEY (id)
) ENGINE=MyISAM AUTO_INCREMENT=15 DEFAULT CHARSET=utf8;

  • 写回答

8条回答 默认 最新

  • uniquewdl 2017-09-02 00:53
    关注

    楼主没有设置编码吧,设置成utf8

    评论

报告相同问题?

悬赏问题

  • ¥15 如何在scanpy上做差异基因和通路富集?
  • ¥20 关于#硬件工程#的问题,请各位专家解答!
  • ¥15 关于#matlab#的问题:期望的系统闭环传递函数为G(s)=wn^2/s^2+2¢wn+wn^2阻尼系数¢=0.707,使系统具有较小的超调量
  • ¥15 FLUENT如何实现在堆积颗粒的上表面加载高斯热源
  • ¥30 截图中的mathematics程序转换成matlab
  • ¥15 动力学代码报错,维度不匹配
  • ¥15 Power query添加列问题
  • ¥50 Kubernetes&Fission&Eleasticsearch
  • ¥15 報錯:Person is not mapped,如何解決?
  • ¥15 c++头文件不能识别CDialog