时间戳中的 MySQL 错误 [英] MySQL error in timestamp

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

问题描述

我正在为我的应用程序创建一个数据库.我收到此错误:MySQL 说:文档

I am creating a database for my application. I get this error: MySQL said: Documentation

  PRIMARY KEY  (UserID))' at line 4 .

这是我的sql语句:

CREATE TABLE sitheloChat_Users (
  UserID int(10) unsigned NOT NULL auto_increment,
  Username varchar(15) NOT NULL default '',
  PreviousUpdate timestamp(14) NOT NULL,
  PRIMARY KEY  (UserID)
);

我必须添加或编辑什么?

What must i add or edit?

推荐答案

从时间戳中移除 (14)

Remove the (14) from timestamp

 mysql> CREATE TABLE sitheloChat_Users 
( UserID int(10) unsigned NOT NULL auto_increment,
 Username varchar(15) NOT NULL default '', 
PreviousUpdate timestamp NOT NULL, PRIMARY KEY (UserID) );
    Query OK, 0 rows affected (0.03 sec)

这篇关于时间戳中的 MySQL 错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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