【发布时间】:2023-02-05 09:58:48
【问题描述】:
我使用以下代码在 MySQL 上创建了一个表:
CREATE TABLE IF NOT EXISTS auth (
id INT AUTO_INCREMENT,
email VARCHAR(50) UNIQUE NOT NULL PRIMERY KEY,
password VARCHAR(250) NOT NULL,
username VARCHAR(50) UNIQUE,
admin BOOLEAN NOT NULL DEFAULT 0,
created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP
);
但是我得到了这个错误:
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 'PRIMERY KEY,
password VARCHAR(250) NOT NULL,
username VARCHAR(50) UNIQUE,
问题是什么?
【问题讨论】:
标签: mysql syntax primary-key create-table