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

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 executingphp 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

mysqlversion is too low,jsontype fields can only be used on the>=mysql5.7version.

    Latest Downloads
    More>
    Web Effects
    Website Source Code
    Website Materials
    Front End Template
    About us Disclaimer Sitemap
    php.cn:Public welfare online PHP training,Help PHP learners grow quickly!