Skip to content

迁移数据提示1064syntax error #3

@junk123321

Description

@junk123321

运行命令php artisan migrate,提示1064 。数据库版本是10.1.40-MariaDB。Innodb引擎,utf8mb4_general_ci编码。

D:\laravel\cms>php artisan migrate
Migration table created successfully.
Migrating: 2014_10_12_000000_create_users_table
Migrated: 2014_10_12_000000_create_users_table
Migrating: 2014_10_12_100000_create_password_resets_table
Migrated: 2014_10_12_100000_create_password_resets_table
Migrating: 2017_03_16_195041_create_articles_table

Illuminate\Database\QueryException : SQLSTATE[42000]: Syntax error or access violation: 1064 You have an error in your SQL syntax; check the manual that cor
responds to your MariaDB server version for the right syntax to use near 'json null comment '附加属性', thumb varchar(255) null comment '封面', i' at line 1 (SQL: create table lara_articles (idint unsigned not null auto_increment primary key,object_idchar(36) not null comment 'objectId',aliasvarchar(150) null comment '别名',titlevarchar(150) not null comment '文章标题',subtitlevarchar( 150) null comment '副标题',keywordsvarchar(150) null comment '关键字',descriptio
nvarchar(255) null comment '文章描述',authorvarchar(60) null comment '文章作者',
sourcevarchar(50) null comment '文章来源',contenttext not null comment '文章内容',attributejson null comment '附加属性',thumbvarchar(255) null comment '封面',
is_linkenum('0', '1') not null default '0' comment 'isLink',linkvarchar(25 5) null comment 'Link',typevarchar(30) not null comment '类型',reply_countint unsigned not null default '0' comment '回复量',viewsint unsigned not null d efault '0' comment '浏览数',orderint not null default '0' comment '排序',weight
int not null default '0' comment '权重',templatevarchar(255) null comment '模 板',csstext null comment 'style',jstext null comment 'javascript',topenum('0', '1') not null default '0' comment '置顶',statusenum('0', '1', '2') n ot null default '1' comment '状态',created_opint not null default '0' comment '创建人',updated_opint not null default '0' comment '更新人',created_attimesta mp null,updated_attimestamp null,deleted_attimestamp null) default chara cter set utf8mb4 collate 'utf8mb4_general_ci') mp null,updated_attimestamp null,deleted_at` timestamp null) default chara
cter set utf8mb4 collate 'utf8mb4_general_ci')

at D:\laravel\cms\vendor\laravel\framework\src\Illuminate\Database\Connection.
php:664
660| // If an exception occurs when attempting to run a query, we'll
format the error
661| // message to include the bindings with SQL, which will make th
is exception a
662| // lot more helpful to the developer instead of just the databa
se's errors.
663| catch (Exception $e) {

664| throw new QueryException(
665| $query, $this->prepareBindings($bindings), $e
666| );
667| }
668|

Exception trace:

1 Doctrine\DBAL\Driver\PDOException::("SQLSTATE[42000]: Syntax error or acce
ss violation: 1064 You have an error in your SQL syntax; check the manual that c
orresponds to your MariaDB server version for the right syntax to use near 'json
null comment '附加属性', thumb varchar(255) null comment '封面', `i' at line 1")
t line 1")
D:\laravel\cms\vendor\doctrine\dbal\lib\Doctrine\DBAL\Driver\PDOConnection
.php:63

2 PDOException::("SQLSTATE[42000]: Syntax error or access violation: 1064 Yo
u have an error in your SQL syntax; check the manual that corresponds to your Ma
riaDB server version for the right syntax to use near 'json null comment '附加属性',
thumb varchar(255) null comment '封面', `i' at line 1")
t line 1")
D:\laravel\cms\vendor\doctrine\dbal\lib\Doctrine\DBAL\Driver\PDOConnection
.php:61

Please use the argument -v to see more details.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions