# Setting SQL mode doesn't take effect

**URL:** <https://community.localwp.com/t/setting-sql-mode-doesnt-take-effect/27898>\
**Category:** Support\
**Created:** [September 26, 2021, 10:28pm UTC](https://community.localwp.com/t/setting-sql-mode-doesnt-take-effect/27898 "2021-09-26T22:28:03Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![IsaacBen](https://sea1.discourse-cdn.com/flex019/user_avatar/community.localwp.com/isaacben/32/9179_2.png) [@IsaacBen](https://community.localwp.com/u/IsaacBen)\
**Post date:** [September 26, 2021, 10:28pm UTC](https://community.localwp.com/t/setting-sql-mode-doesnt-take-effect/27898/1 "2021-09-26T22:28:03Z")

</div>

### Issue Summary

I’m trying to set the SQL mode to be compatible with WordPress:

```auto
sql_mode=NO_ZERO_IN_DATE,ERROR_FOR_DIVISION_BY_ZERO,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION

```

I could only find two `my.cnf` files and editing either of them doesn’t take effect.  
There’s this - `Local/lightning-services/mysql-5.7.28+4/conf/my.cnf.hbs` - the changes I make here persists during stoping/starting the site.

And there’s this - `Local/run/YBpi-cZQF/conf/mysql/my.cnf` - the changes I make here are being removed whenever I stop/start the site.

Are there any other files I’m missing which I can edit?

#### System Details

- Which version of Local is being used?  
5.9.4.

- What Operating System (OS) and OS version is being used?  
macOS Catalina

---

<div class="post-metadata">

**Author:** ![IsaacBen](https://sea1.discourse-cdn.com/flex019/user_avatar/community.localwp.com/isaacben/32/9179_2.png) [@IsaacBen](https://community.localwp.com/u/IsaacBen)\
**Post date:** [September 26, 2021, 11:45pm UTC](https://community.localwp.com/t/setting-sql-mode-doesnt-take-effect/27898/2 "2021-09-26T23:45:50Z")

</div>

I did find a workaround for anyone facing this. I just run this in TablePlus every time the server reboots:

```auto
SET SESSION sql_mode=('NO_ZERO_IN_DATE,ERROR_FOR_DIVISION_BY_ZERO,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION');

```

---

<div class="post-metadata">

**Author:** ![system](https://sea1.discourse-cdn.com/flex019/user_avatar/community.localwp.com/system/32/1_2.png) [@system](https://community.localwp.com/u/system)\
**Post date:** [December 25, 2021, 11:46pm UTC](https://community.localwp.com/t/setting-sql-mode-doesnt-take-effect/27898/3 "2021-12-25T23:46:09Z")

</div>

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.
