我已经安装了 MariaDB ,我发现了一些尝试创建这个简单表格的困难:
CREATE
TABLE testdb.ACCOMODATION
(
Id BIGINT NOT NULL AUTO_INCREMENT,
user_id BIGINT(30) NOT NULL,
name VARCHAR(100) NOT NULL,
address VARCHAR(255) NOT NULL,
tel VARCHAR(50) NOT NULL,
mobile VARCHAR(50) NOT NULL,
fax VARCHAR(50) NOT NULL,
email VARCHAR(255) NOT NULL,
zip VARCHAR(16) NOT NULL,
nation VARCHAR(30) NOT NULL,
region VARCHAR(30) NOT NULL,
province VARCHAR(30) NOT NULL,
municipality VARCHAR(30) NOT NULL,
stars ENUM('ONE', 'TWO', 'THREE', 'FOUR', 'FIVE') NOT NULL,
lat DECIMAL(10, 8),
lng DECIMAL(11, 8),
CONSTRAINT fk_accomodation_user FOREIGN KEY (user_id) REFERENCES testdb.USER (id),
PRIMARY KEY (Id)
)
ENGINE=InnoDB DEFAULT CHARSET=latin1
当我在 DB Visualizer (我用来与我的数据库交互的IDE)中执行此查询时,我收到以下错误消息:
11:26:01 [CREATE - 0 row(s), 0.000 secs] Could not getColumn for MyMariaDB: Unknown system variable 'OPTION'
... 1 statement(s) executed, 0 row(s) affected, exec/fetch time: 0.000/0.000 sec [0 successful, 0 warnings, 1 errors]
答案 0 :(得分:0)
尝试设置ID UNSIGNEd而不是UNISGNED