diff --git a/src/wp-includes/wp-db.php b/src/wp-includes/wp-db.php index ae0ec7ec94..91ad6f2286 100644 --- a/src/wp-includes/wp-db.php +++ b/src/wp-includes/wp-db.php @@ -2810,7 +2810,16 @@ class wpdb { $client_version = mysql_get_client_info(); } - return version_compare( $client_version, '5.5.3', '>=' ); + /* + * libmysql has supported utf8mb4 since 5.5.3, same as the MySQL server. + * mysqlnd has supported utf8mb4 since 5.0.9. + */ + if ( false !== strpos( $client_version, 'mysqlnd' ) ) { + $client_version = preg_replace( '/^\D+([\d.]+).*/', '$1', $client_version ); + return version_compare( $client_version, '5.0.9', '>=' ); + } else { + return version_compare( $client_version, '5.5.3', '>=' ); + } } return false;