Issue with SQL syntax on MySQL 8.0.36 Topic is solved

General questions relating to Joomla! 3.x.

Moderator: General Support Moderators

Forum rules
Forum Rules
Absolute Beginner's Guide to Joomla! <-- please read before posting.
Forum Post Assistant - If you are serious about wanting help, you should use this tool to help you post.
Windows Defender SmartScreen Issues <-- please read this if using Windows 10
Post Reply
iorbita
Joomla! Apprentice
Joomla! Apprentice
Posts: 6
Joined: Sun Oct 22, 2017 9:04 pm

Issue with SQL syntax on MySQL 8.0.36

Post by iorbita » Tue Mar 12, 2024 9:01 am

Hi everyone,
I've migrated a few sites to another host, for one of the sites and only for the blog section (blog by EasyBlog) I'm getting an SQL error that I don't get if the site is installed locally or if it's installed at the previous host.

The problem comes from the server database version.

Previous host: MariaDB 10.2.44 -> no problem
Local: MySQL 5.7.39 -> no problem
New host: MySQL 8.0.36 -> problem.

Here's the error I get:

Code: Select all

"You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'DESC ORDER BY a.`created` DESC' at line 1"
After some research on the web it seems that a query uses an alias (a.created) in the ORDER BY clause, which is incompatible with MySQL 8.0.36.
I've tried some SQL rules in phpMyAdmin on a development site but basically I don't know which table to target because EasyBlog has a lot of them and honestly I don't even know if my SQL rule is correct...

Can anyone tell me how to fix this?

Many thanks,
Lorenzo

Joomla 3.10.12
PHP 7.4.33

iorbita
Joomla! Apprentice
Joomla! Apprentice
Posts: 6
Joined: Sun Oct 22, 2017 9:04 pm

Re: Issue with SQL syntax on MySQL 8.0.36

Post by iorbita » Tue Mar 12, 2024 1:28 pm

... I share the fix, perhaps someone will need it.

In this case, you need to delete the DESC string in /administrator/components/com_easyblog/models/archive.php on line 327.

Image
Last edited by iorbita on Tue Mar 12, 2024 2:03 pm, edited 1 time in total.

User avatar
pe7er
Joomla! Master
Joomla! Master
Posts: 24986
Joined: Thu Aug 18, 2005 8:55 pm
Location: Nijmegen, Netherlands
Contact:

Re: Issue with SQL syntax on MySQL 8.0.36

Post by pe7er » Tue Mar 12, 2024 1:33 pm

Good to see that you've solved it yourself. Thanks for sharing your solution!
Kind Regards,
Peter Martin, Global Moderator
Company website: https://db8.nl/en/ - Joomla specialist, Nijmegen, Netherlands
The best website: https://the-best-website.com


Post Reply

Return to “General Questions/New to Joomla! 3.x”