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 如何用Labview在myRIO上做LCD显示?(语言-开发语言)
  • ¥15 Vue3地图和异步函数使用
  • ¥15 C++ yoloV5改写遇到的问题
  • ¥20 win11修改中文用户名路径
  • ¥15 win2012磁盘空间不足,c盘正常,d盘无法写入
  • ¥15 用土力学知识进行土坡稳定性分析与挡土墙设计
  • ¥70 PlayWright在Java上连接CDP关联本地Chrome启动失败,貌似是Windows端口转发问题
  • ¥15 帮我写一个c++工程
  • ¥30 Eclipse官网打不开,官网首页进不去,显示无法访问此页面,求解决方法
  • ¥15 关于smbclient 库的使用