PHPackages                             spliffs/mysqlfixer - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Database &amp; ORM](/categories/database)
4. /
5. spliffs/mysqlfixer

ActiveSilverstripe-module[Database &amp; ORM](/categories/database)

spliffs/mysqlfixer
==================

Fix problems with MySQL-DB &gt; 5.7.5 and some SilverStripe modules

0.0.2(8y ago)0400PHP

Since Nov 28Pushed 8y ago1 watchersCompare

[ Source](https://github.com/SpliffSplendor/silverstripe-mysqlfixer)[ Packagist](https://packagist.org/packages/spliffs/mysqlfixer)[ RSS](/packages/spliffs-mysqlfixer/feed)WikiDiscussions master Synced today

READMEChangelogDependencies (1)Versions (3)Used By (0)

MySQL Fixer Module
==================

[](#mysql-fixer-module)

This is intended to *fix* problem `Expression #1 of ORDER BY clause is not in SELECT list.....which is not in SELECT list; this is incompatible with DISTINCT` caused by some modules.

The distinct *error* occures with MySQL &gt;5.7.5 where the option **ONLY\_FULL\_GROUP\_BY** became part of the combination on **ANSI** (which also includes 'REAL\_AS\_FLOAT, PIPES\_AS\_CONCAT, ANSI\_QUOTES, IGNORE\_SPACE') used by SilverStripe for sql\_mode.

( See also here  )

This module introduces the MySQL57Database class which extends the MySQLDatabase class, or better overwrites the connect() method using the sql\_mode *'REAL\_AS\_FLOAT,PIPES\_AS\_CONCAT,ANSI\_QUOTES,IGNORE\_SPACE'* and instead of to *'ANSI'*.

Maintainer Contact
------------------

[](#maintainer-contact)

Spliff Splendor &lt;Spliff (dot) Splendor (at) gmail (dot) com&gt;

Requirements
------------

[](#requirements)

- SilverStripe 3.3 or newer

Installation
------------

[](#installation)

- If using composer, run `composer require spliffs/mysqlfixer`.
- Otherwise, download, unzip and copy the 'mysqlfixer' folder to your project root so that it becomes a sibling of `framework/`.

Configuration
-------------

[](#configuration)

Add this to your \_config.php (right after 'require\_once("conf/ConfigureFromEnv.php");') or in your \_ss\_environment.php where you configure your database.

### Sample/Excerpt \_ss\_environment.php

[](#sampleexcerpt-_ss_environmentphp)

```
// DB config
define('SS_DATABASE_CLASS', 'MySQL57Database');`
define('SS_DATABASE_SERVER',   'mysql5.7.20.local');
define('SS_DATABASE_USERNAME', 'dbuser');
define('SS_DATABASE_PASSWORD', 'top-secret-password');
define('SS_DATABASE_NAME',   'ss_mysite');
```

### Sample mysite/\_config.php

[](#sample-mysite_configphp)

```
