• 手机版

    扫码体验手机版

  • 微信公众号

    扫码关注公众号

国内首家协议开发

软芯音视解码保护平台

在线
客服

发布
需求

在线
聊天

天盟
APP

天盟APP下载

关注
微信

微信扫一扫访问
顶部

为什么建表全部报错了!

CREATE DATABASE IF NOT EXISIS 'shopImooc';
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 'EXISIS 'shopImooc'' at line 1
mysql> USE 'shopImooc';
ERROR 1049 (42000): Unknown database 'shopimooc'
mysql> --管理员表
    -> DROP TABLE IF EXISTS 'imooc_admin';
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 '--管 理员表
DROP TABLE IF EXISTS 'imooc_admin'' at line 1
mysql> CREATE TABLE 'imooc_admin'(
    -> 'id' tinyint unsigned auto_increment key,
    -> 'username' varchar(20) not null unique,
    -> 'password' char(32) not null,
    -> 'email' varchar(50) not null
    -> )charset=utf8;
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 ''imooc_admin'(
'id' tinyint unsigned auto_increment key,
'username' varchar(20) ' at line 1
mysql>
mysql> --分类表
    -> DROP TABLE IF EXISTS 'imooc_cate';
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 '--分 类表
DROP TABLE IF EXISTS 'imooc_cate'' at line 1
mysql> CREATE TABLE 'imooc_cate'(
    -> 'id' smallint unsigned auto_increment key,
    -> 'cName' varchar(50) unique
    -> )charset=utf8;
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 ''imooc_cate'(
'id' smallint unsigned auto_increment key,
'cName' varchar(50) uni' at line 1
mysql>
mysql> --产品表
    -> DROP TABLE IF EXISTS 'imooc_pro';
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 '--产 品表
DROP TABLE IF EXISTS 'imooc_pro'' at line 1
mysql> CREATE TABLE 'imooc_pro'(
    -> 'id' int unsigned auto_increment key,
    -> 'pName' varchar(50) not null unique,
    -> 'pSn' varchar(50) not null,
    -> 'pNum' int unsigned default 1,
    -> 'mPrice' decimal(10,2) not null,
    -> 'iPrice' decimal(10,2) not null,
    -> 'pDesc' text,
    -> 'pImg' varchar(50) not null,
    -> 'pubTime' int unsigned not null,
    -> 'isShow' tinyint(1) default 1,
    -> 'isHot' tinyint(1) default 0,
    -> 'cId' smallint unsigned not null
    -> )charset=utf8;
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 ''imooc_pro'(
'id' int unsigned auto_increment key,
'pName' varchar(50) not null ' at line 1
mysql>
mysql> --用户表
    -> DROP TABLE EXISTS 'imooc_user';
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 '--用 户表
DROP TABLE EXISTS 'imooc_user'' at line 1
mysql> CREATE TABLE 'imooc_user'(
    -> 'id' int unsigned auto_increment key,
    -> 'username' varchar(20) not null unique,
    -> 'password' char(32) not null,
    -> 'sex' enum("男","女","保密") not null default "保密",
    -> 'face' varchar(50) not null,
    -> 'regTime' int unsigned not null
    -> )charset=utf8;
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 ''imooc_user'(
'id' int unsigned auto_increment key,
'username' varchar(20) not n' at line 1
mysql>
mysql> --相册表
    -> DROP TABLE IF EXISTS 'imooc_album';
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 '--相 册表
DROP TABLE IF EXISTS 'imooc_album'' at line 1
mysql> CREATE TABLE 'imooc_album'(
    -> 'id' int unsigned auto_increment key,
    -> 'pid' int unsigned not null,
    -> 'albumPass' varchar(50) not null
    -> )charset=utf8;
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 ''imooc_album'(
'id' int unsigned auto_increment key,
'pid' int unsigned not null' at line 1

免责声明:本内容仅代表回答会员见解不代表天盟观点,请谨慎对待。

版权声明:作者保留权利,不代表天盟立场。

使用道具 举报

全部参与2

应该是包裹数据库名和表名的两个引号写错了,是键盘左上角的那个顿号形式的,不是双引号那个。

使用道具 举报

''   ``

使用道具 举报

发新帖

发布任务需求已有1031289位用户正在使用天盟网服务

发布分类: *
任务预算: *
需求内容: *
手机号码: *
任务商家报价为
  • 预算价 :
  • 成交价 :
  • 完工期 :
  • 质保期 :

* 最终任务项目以服务商报价、双方协商为准!