<p>Brad was correct in the comments above. The answer is the sql_mode. This is a duplicate of <a href="https://craftcms.stackexchange.com/questions/12084/getting-this-sql-error-group-by-incompatible-with-sql-mode-only-full-group-by">Getting this SQL Error: GROUP BY incompatible with sql_mode=only_full_group_by</a></p>

CC BY-SA 4.0
2019-02-25T13:51:33.983Z
2019-02-25T13:51:33.983Z
FuzzyJelly
<blockquote>
  <p>CDbCommand failed to execute the SQL statement: SQLSTATE[42000]: Syntax error or access violation: 1055 Expression #28 of SELECT list is not in GROUP BY clause and contains nonaggregated column 'site.structureelements.root' which is not functionally dependent on columns in GROUP BY clause; this is incompatible with sql_mode=only_full_group_by.</p>
</blockquote>

<p>The site is working locally through MAMP, and on a remote apache dev server. I have an nginx server built for shared hosting through Laravel Forge. All of the PHP settings are identical, and I used the database backup from the dev site.</p>

<p>I removed all of the tables and the standard craft install worked fine.</p>

CC BY-SA 4.0
2019-02-14T01:16:31.253Z
Possible duplicate of [Getting this SQL Error: GROUP BY incompatible with sql\_mode=only\_full\_group\_by](https://craftcms.stackexchange.com/questions/12084/getting-this-sql-error-group-by-incompatible-with-sql-mode-only-full-group-by)
Brad Bell
CC BY-SA 4.0
2019-02-14T01:16:42.270Z
This should get you sorted: https://craftcms.stackexchange.com/questions/12084/getting-this-sql-error-group-by-incompatible-with-sql-mode-only-full-group-by
Brad Bell
<database><mysql><craft2>
What is CDbException Error: SQLSTATE[42000]: Syntax error or access violation while moving a site to remote?
# What is CDbException Error: SQLSTATE[42000]: Syntax error or access violation while moving a site to remote?

(Asked by: username_0 on 2019-02-14)

> CDbCommand failed to execute the SQL statement: SQLSTATE[42000]: Syntax error or access violation: 1055 Expression #28 of SELECT list is not in GROUP BY clause and contains nonaggregated column 'site.structureelements.root' which is not functionally dependent on columns in GROUP BY clause; this is incompatible with sql\_mode=only\_full\_group\_by.

The site is working locally through MAMP, and on a remote apache dev server. I have an nginx server built for shared hosting through Laravel Forge. All of the PHP settings are identical, and I used the database backup from the dev site.

I removed all of the tables and the standard craft install worked fine.

**Tags:** database, mysql, craft2
> **Comments:**
> **username_1**: Possible duplicate of [Getting this SQL Error: GROUP BY incompatible with sql\_mode=only\_full\_group\_by](https://craftcms.stackexchange.com/questions/12084/getting-this-sql-error-group-by-incompatible-with-sql-mode-only-full-group-by)  
> **username_1**: This should get you sorted: https://craftcms.stackexchange.com/questions/12084/getting-this-sql-error-group-by-incompatible-with-sql-mode-only-full-group-by  

---

## 1 answers

### Answer by username_0 on 2019-02-25. Score: 1 | Accepted answer

Brad was correct in the comments above. The answer is the sql\_mode. This is a duplicate of [Getting this SQL Error: GROUP BY incompatible with sql\_mode=only\_full\_group\_by](https://craftcms.stackexchange.com/questions/12084/getting-this-sql-error-group-by-incompatible-with-sql-mode-only-full-group-by)


---

