Can anyone check and confirm whether this function works and if not, present any reasonable work-around solution? Many thanks in advance. I have installed XAMPP with:
10.4.21-MariaDB
PHP Version 8.0.10
Check your syntax and your spelling. Of course there’s no function called “JSON_OBJECTTAGG” but a function called JSON_OBJECT()
.
Thanks Sam, well this doesn’t produce the expected result. But fortunately I’ve found a solution that works, at least for me. Here the code for other students.
REGEXP_REPLACE(GROUP_CONCAT(JSON_OBJECT( )), '(},{)', ',')
It’s completely useless to post a “solution” without describing the problem to solve.
The problem to solve is JSON_OBJECTTAGG, as in my first post. Sorry, Sam, it’s not my role to teach mySql.
Althought MySQL has it since 5.7.22 I didn’t know that function. The name looked like a typo to me.
MariaDB has it since 10.5.0. Your 10.4.21 from late 2018 is rather old.
Thank you. I’ve just realized that Xampp is using Maria and mySQL Workbench not, and this makes a difference. Please let me ask about tech point. Maria uses 3306 port, that is the same config as mySQL. Can I use this port for both apps without any conflict?
A port is an exclusive resource. If you want to use both MariaDB and MySQL server on the same machine you have to configure one of them to use a different port.
From my experience MySQL Workbench has problems talking to MariaDB. If you want to use MariaDB consider using a different tools such as HeidiSQL.