MySQL表'用户'已经存在

时间:2017-11-25 14:05:50

标签: php android mysql

CREATE TABLE weeki.users (
    id INT(11) NOT NULL AUTO_INCREMENT,
    username VARCHAR(255) NOT NULL,
    name VARCHAR(50) NOT NULL,
    email VARCHAR(255) NOT NULL,
    password VARCHAR(255) NOT NULL,
    registration_id TEXT DEFAULT NULL,
    api TEXT NOT NULL,
    created_At DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP,
    disabled TINYINT(1) DEFAULT 0,
    status VARCHAR(130) DEFAULT 'Just another user',
    icon TEXT DEFAULT NULL,
    PRIMARY KEY (id),
    UNIQUE INDEX id (id)
)

MySQL#1050 - 表'用户'已存在

1 个答案:

答案 0 :(得分:1)

在您的情况下运行此查询:

  1. 删除现有表格
  2. 创建表格
  3.  DROP TABLE IF EXISTS `weeki.users`;
        CREATE TABLE weeki.users (
            id INT(11) NOT NULL AUTO_INCREMENT,
            username VARCHAR(255) NOT NULL,
            name VARCHAR(50) NOT NULL,
            email VARCHAR(255) NOT NULL,
            password VARCHAR(255) NOT NULL,
            registration_id TEXT DEFAULT NULL,
            api TEXT NOT NULL,
            created_At DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP,
            disabled TINYINT(1) DEFAULT 0,
            status VARCHAR(130) DEFAULT 'Just another user',
            icon TEXT DEFAULT NULL,
            PRIMARY KEY (id),
            UNIQUE INDEX id (id)
        )