建立表格时发生错误 [英] Error while creating table

查看:144
本文介绍了建立表格时发生错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

#1064 - 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 'CREATE TABLE IF NOT EXISTS `users` (   `id` int(11) NOT NULL AUTO_INCREMENT,

-

       CREATE TABLE IF NOT EXISTS `users` (
       `id` int(11) NOT NULL AUTO_INCREMENT,
       `username` varchar(255) NOT NULL,
       `first_name` varchar(255) NOT NULL,
       `last_name` varchar(255) NOT NULL,
       `email` varchar(255) NOT NULL,
       `password` varchar(255) NOT NULL,
       `sign_up_date` date NOT NULL,
       `activated` enum('0','1') NOT NULL,
        PRIMARY KEY (`id`)
        ) ENGINE=InnoDB DEFAULT CHARSET=latin1 AUTO_INCREMENT=1 ;

我再次尝试,并且:"MySQL返回了一个空结果集(即零行).(查询花费了0.0000秒.)"

I tried again and : " MySQL returned an empty result set (i.e. zero rows). (Query took 0.0000 seconds.)"

推荐答案

此内容太详细,无法发表评论.将其复制到SQL Fiddle中会导致以下错误:

This is too detailed for a comment. Copying this into SQL Fiddle results in this error:

架构创建失败:您的SQL语法有错误;检查与您的MySQL服务器版本相对应的手册以获取正确的语法,以在第1行的"附近使用

Schema Creation Failed: 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 '' at line 1:

此字符似乎在分号末尾.

This character appears to be after the semicolon at the end.

代码本身可以正常工作,如此处所示.

The code itself works, as shown here.

这篇关于建立表格时发生错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆