Mysql error: json_set does not exist

Asked

Viewed 107 times

0

I am currently using Laravel to build some projects (personal); I have no experience in the framework, but a problem appeared, apparently due to MYSQL.

I created a table called tabelateste and in this table the following columns

inserir a descrição da imagem aqui

To update the column params I used the update according to the Laravel DOC

update(['params->filter' => $request->input('data')]);

But the error is returned

SQLSTATE[42000]: Syntax error or access Violation: 1305 FUNCTION database.json_set does not exist (SQL: update tabelateste set params = json_set(params, '$."filter"', 1,2,3) Where account = 18)

I’ve done the same query generated by Laravel directly at the Mysql prompt and returned the same error

FUNCTION database.json_set does not exist

The version of my Mysql is 5.7, minimum version requested by Laravel in Doc.

1 answer

0

When checking the version of Mysql (5.7) in source.list and mariaDB (10.1) I realized that the packages were different (the packages of mariaDB referring to Mysql5.7+ are from 10.2).

I decided to remove the current mariaDB (10.1) and install another.

sudo apt-get install software-properties-common dirmngr
sudo apt-key adv --recv-keys --keyserver keyserver.ubuntu.com 0xF1656F24C74CD1D8
sudo add-apt-repository 'deb [arch=amd64,i386,ppc64el] http://mirror.ufscar.br/mariadb/repo/10.2/debian stretch main'

sudo apt-get update
sudo apt-get install mariadb-server

These settings change according to the OS version, these are for Debian 9 stretch

Sources:

Setting UP Mariadb Repos

Dependency problems - Unconfigured Leaving

Browser other questions tagged

You are not signed in. Login or sign up in order to post.