const schema = `
CREATE TABLE IF NOT EXISTS post (
id INT NOT NULL PRIMARY KEY AUTO_INCREMENT,
title varchar(150) NOT NULL,
slug varchar(150) NOT NULL,
markdown text,
html text,
image text,
featured BOOLEAN,
page BOOLEAN,
allow_comment BOOLEAN,
published BOOLEAN,
comment_num INT NOT NULL DEFAULT '0',
language varchar(6) NOT NULL DEFAULT 'en_US',
meta_title varchar(150),
meta_description varchar(200),
created_at datetime NOT NULL,
created_by INT NOT NULL,
updated_at datetime,
updated_by INT,
published_at datetime,
published_by INT
);
CREATE TABLE IF NOT EXISTS tokens (
id INT NOT NULL PRIMARY KEY AUTO_INCREMENT,
value varchar(40) NOT NULL,
user_id INT UNIQUE,
created_at datetime,
expired_at datetime
);
`
这是golang中的语句,只写一个建表语句的话可以执行成功,写多个的话报错.
各位大佬有什么解决方法吗?
有疑问加站长微信联系(非本文作者)

分两次执行会报错吗?
分两次执行是?
你这里有两个create 语句 分为两个string执行两次看看。