V2EX = way to explore
V2EX 是一个关于分享和探索的地方
现在注册
已注册用户请  登录
MySQL 5.5 Community Server
MySQL 5.6 Community Server
Percona Configuration Wizard
XtraBackup 搭建主从复制
Great Sites on MySQL
Percona
MySQL Performance Blog
Severalnines
推荐管理工具
Sequel Pro
phpMyAdmin
推荐书目
MySQL Cookbook
MySQL 相关项目
MariaDB
Drizzle
参考文档
http://mysql-python.sourceforge.net/MySQLdb.html
cc7756789
V2EX  ›  MySQL

MySQL 建表错误求解

  •  
  •   cc7756789 · 2015-07-09 09:54:38 +08:00 · 2365 次点击
    这是一个创建于 3222 天前的主题,其中的信息可能已经有所发展或是发生改变。

    6 条回复    2015-07-09 10:18:02 +08:00
    em70
        1
    em70  
       2015-07-09 10:00:44 +08:00 via Android
    只有我看不到你发的图片吗
    timsims
        2
    timsims  
       2015-07-09 10:02:45 +08:00   ❤️ 1
    是url char (100) not null

    后面的也是这个问题
    kn007
        3
    kn007  
       2015-07-09 10:05:55 +08:00   ❤️ 1
    @em70 我看得到
    用``把表名标记一下试试,最好规范为,如:
    `url` char(100) NOT NULL,
    arron
        4
    arron  
       2015-07-09 10:07:25 +08:00   ❤️ 1
    CREATE TABLE `my` (
    `id` int(11) unsigned NOT NULL AUTO_INCREMENT,
    `url` char(100) NOT NULL,
    `title` char(100) NOT NULL,
    `treat` varchar(700) NOT NULL,
    `presentation` varchar(700) NOT NULL,
    PRIMARY KEY (`id`)
    );
    cc7756789
        5
    cc7756789  
    OP
       2015-07-09 10:07:30 +08:00
    问题解决
    确实是 NOT NULL 在 char前面导致的
    Septembers
        6
    Septembers  
       2015-07-09 10:18:02 +08:00
    MySQL有问题啃文档,文档上有完整的文法,按照文法新准没错
    关于   ·   帮助文档   ·   博客   ·   API   ·   FAQ   ·   我们的愿景   ·   实用小工具   ·   2483 人在线   最高记录 6543   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 26ms · UTC 12:19 · PVG 20:19 · LAX 05:19 · JFK 08:19
    Developed with CodeLauncher
    ♥ Do have faith in what you're doing.