Warning: file_get_contents(/data/phpspider/zhask/data//catemap/5/sql/80.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Mysql 为什么选择在mariadb中不工作的json数据?_Mysql_Sql_Phpmyadmin_Mariadb_Version - Fatal编程技术网

Mysql 为什么选择在mariadb中不工作的json数据?

Mysql 为什么选择在mariadb中不工作的json数据?,mysql,sql,phpmyadmin,mariadb,version,Mysql,Sql,Phpmyadmin,Mariadb,Version,我的问题是这样的: select `information`->'$."full_name"' as `homeroom` from `classes` 如果查询在我的本地数据库中运行,它就会工作。无误 但是,如果查询在我的数据库服务器中运行,它将不起作用。存在如下错误: #1064 - You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server versi

我的问题是这样的:

select `information`->'$."full_name"' as `homeroom` 
from `classes`
如果查询在我的本地数据库中运行,它就会工作。无误

但是,如果查询在我的数据库服务器中运行,它将不起作用。存在如下错误:

#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 '>'$."full_name"' as `homeroom` 
from `classes` LIMIT 0, 25' at line 1
如果我运行select version

我的版本数据库本地:8.0.15

我的版本数据库服务器:10.0.38-MariaDB

因为我的数据库服务器使用mariadb,所以它似乎不起作用

我怎样才能解决这个问题

更新:


直到10.2.3版,我才将数据类型文本用于信息字段的JSON函数添加到MariaDB中。如果无法升级,则必须处理应用程序中的数据。请注意,即使在支持JSON的版本中,它们也不支持->符号,因此您必须将查询重写为

JSON_EXTRACT(information, '$.full_name')

我怎样才能解决这个问题?了解更多原因,以确保从现在开始,在测试/开发和生产中使用相同的数据库供应商、主要版本和次要版本exist@SuccessMan这就是我所说的,你的MariaDB版本不够新,无法支持它们。您需要升级或处理应用程序中的数据。