Laravel database field json format error reporting
ringa_lee
ringa_lee 2017-05-16 16:46:49
0
1
666

Using laravel5.4, there is a field in json format, which is defined in the migration file like this:

$table->json('fruits')->nullable();

Error reporting when executing php artisan migrate:

SQLSTATE[42000]: Syntax error or access violation: 1064 You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'json null' at line 1
ringa_lee
ringa_lee

ringa_lee

reply all(1)
阿神

The

mysql version is too low, json type fields can only be used on the >=mysql5.7 version.

Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template