last day (26 days later) » 

5:56 PM
0
Q: WordPress query error when upgrading to mysql 8.0

zsquareI'm upgrading my Wordpress / WooCommerce website to a newer setup, from PHP 7.0 to 7.2, and MySQL 5.0 to 8.0. I've ported all the data, and have the site running, but, large parts of the website don't seem to load. When turning on debug mode, I can see errors like the following at multiple place...

 
You could fix the query.
 
@hNczy not really.
@PaulSpiegel the query is from within wordpress. I don't want to make changes to the source code to get this to work.It seems like too common a use case to warrant that.
 
Then you can change the SQL mode per session in PHP code after the connection is established. But don't ask me, where to that in WP.
 
@PaulSpiegel tried doing that using mysqlclient, but, insufficient permissions.
 
What command did you use?
 
5:56 PM
@PaulSpiegel SET GLOBAL sql_mode=(SELECT REPLACE(@@sql_mode,'ONLY_FULL_GROUP_BY',''));'
 
Use SET SESSION sql_mode = REPLACE(@@sql_mode, 'ONLY_FULL_GROUP_BY', ''). You need to execute this query in PHP, because it only affects the current session/connection.
It seems WB is already doing that in set_sql_mode()
 
Yeah, I got there too. I'm trying to figure out how to override the modes.
 
See: protected $incompatible_modes - ONLY_FULL_GROUP_BY is listed there. So it should be removed already.
 
True. Hmm. Any idea how I can get wp to print what it's finally setting as the modes?
 
you need to execute SELECT @@sql_mode somewhere
 
5:59 PM
Let me figure out how wp does logging and see if I can get it to print inthe logs
thanks for your help btw, appreciate it
 
6:18 PM
ok, I got it to print
and, it doesn't include ONLY_FULL_GROUP_BY
so then, how come it's still facing that error?
 
what is the exact mysql version?
 
mysql Ver 8.0.17 for Linux on x86_64 (MySQL Community Server - GPL)
 
I have no idea. Here is something similar.. but it work on 8.0.12: db-fiddle.com/f/6dtR5sFkYSLuvWHw2BNj63/0
Works an 8.0.17 too: dbfiddle.uk/…
You need to create a simple, small but reproducible example
 
6:36 PM
yeah, trying to setup a fresh install
seems like most of the errors are coming from woocommerce, and the template
*theme
I noticed that was out of date, tried upgrading that, but still no dice
 
You should also edit your question accordingly. Since you now not asking how to disable the mode.
 
true
updating
 
Have to leave now.. good luck!
 
no worries
thanks!
 

last day (26 days later) »