Create a gist now

Instantly share code, notes, and snippets.

What would you like to do?
patch wp-includes/wp-db.php on a mysql server that is set up to normally run as SQL_MODE="ANSI,TRADITIONAL,ONLY_FULL_GROUP_BY" -- which wordpress currently barfs all over because it has not yet been reconfigured to run on a strict server, so that this way, wordpress will function as it normally would on a default mysql server with no strictness …
--- wp-includes/wp-db.php 2013-06-21 14:41:52.000000000 -0400
+++ wp-includes/wp-db.php 2013-07-23 18:37:01.298896949 -0400
@@ -1166,6 +1166,7 @@
$this->ready = true;
$this->select( $this->dbname, $this->dbh );
+ mysql_query( "SET sql_mode=''", $this->dbh);

WebDragon commented Feb 5, 2014

The problem has now been fixed in wordpress core (insofar, at least, as a similar workaround -- not ACTUALLY by making wordpress able to function properly in a strict environment) with a bit more detail than my simple patch due to how mysql 5.6 ships with more strictness on by default (good for them! about time, too.)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment