# MySQL configuration: where to edit?

**URL:** <https://community.localwp.com/t/mysql-configuration-where-to-edit/45619>\
**Category:** Support\
**Created:** [November 19, 2024, 4:25pm UTC](https://community.localwp.com/t/mysql-configuration-where-to-edit/45619 "2024-11-19T16:25:28Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![EvgeniyO](https://avatars.discourse-cdn.com/v4/letter/e/6de8d8/32.png) [@EvgeniyO](https://community.localwp.com/u/EvgeniyO)\
**Post date:** [November 19, 2024, 4:25pm UTC](https://community.localwp.com/t/mysql-configuration-where-to-edit/45619/1 "2024-11-19T16:25:28Z")

</div>

There are two kinds of MySQL my.cnf files in localWP environment:

1. “C:\Users\username\AppData\Roaming\Local\run\KzjdzfKVS\conf\mysql\my.cnf”
2. “C:\Users\username\AppData\Roaming\Local\lightning-services\mysql-8.0.16+6\conf\my.cnf.hbs”

In AdminerEvo I have two databases I need to work with: Wordpress’ own, and another one, which is populated by scraper. I want to use MySQL event scheduler to autosync tables from the scraper db into WP’s db.

Which file should I edit with `SET GLOBAL event_scheduler = ON;` to have configuration for all databases?

---

<div class="post-metadata">

**Author:** ![Nick-B](https://sea1.discourse-cdn.com/flex019/user_avatar/community.localwp.com/nick-b/32/16140_2.png) [@Nick-B](https://community.localwp.com/u/Nick-B)\
**Post date:** [November 20, 2024, 3:34pm UTC](https://community.localwp.com/t/mysql-configuration-where-to-edit/45619/2 "2024-11-20T15:34:59Z")

</div>

Hey @EvgeniyO

Item 1 is your active configuration file used by the MySQL server instance tied to your specific LocalWP site. Changes here will directly impact the site’s MySQL instance.

The second file is used by LocalWP to generate `my.cnf` files for new site environments. Changes here only take effect when new MySQL configurations are created.

As far as enabling the event scheduler for all active databases in your LocalWP site, I have not tested it but the steps might look like this:

1. Edit the Active Configuration File (`my.cnf`):

2. Temporary Activation:

After making changes, restart the site for the configuration to take effect.

Since you’re working with two databases in AdminerEvo, make sure the MySQL user has the necessary permissions to access both and execute the syncing events.

---

<div class="post-metadata">

**Author:** ![EvgeniyO](https://avatars.discourse-cdn.com/v4/letter/e/6de8d8/32.png) [@EvgeniyO](https://community.localwp.com/u/EvgeniyO)\
**Post date:** [December 4, 2024, 2:30am UTC](https://community.localwp.com/t/mysql-configuration-where-to-edit/45619/3 "2024-12-04T02:30:46Z")

</div>

Hey @Nick-B  
It doesn’t work at all.

I tried to edit `[mysqld]` section, with an entry  
`event_scheduler = ON`  
or  
`secure_file_priv=C:/Users/me/Downloads`  
or  
`secure_file_priv=C:\\Users\me\Downloads`

`my.cnf` is rewritten to original state after each restart of mysql service (LocalWP) - and all my edits disappear.

`my.cnf.hbs` isn’t rewritten, but my entry makes no difference. As explained in [How to edit my.cnf - #4 by ben.turner](https://community.localwp.com/t/how-to-edit-my-cnf/21123/4), `conf\mysql\my.cnf` must be recompiled after restart - but it recompiles into original state, without my entry in `my.cnf.hbs`! After all, the value of `secure_file_priv` is `NULL`.

Where can I effectively edit my MySQL configuration? I need these two options…

Manual start with options fails too, like this:

```auto
C:\Users\me\Local Sites\my\app\public>mysqld --secure-file-priv="C:/Users/me/Downloads"
2024-12-04T02:35:42.878348Z 0 [System] [MY-010116] [Server] C:\Users\me\AppData\Roaming\Local\lightning-services\mysql-8.0.16+6\bin\win64\bin\mysqld.exe (mysqld 8.0.16) starting as process 7164
2024-12-04T02:35:42.879635Z 0 [Warning] [MY-013243] [Server] --character-set-server: The character set UTF8MB3 is deprecated and will be removed in a future release. Please consider using UTF8MB4 instead.
2024-12-04T02:35:42.890882Z 1 [ERROR] [MY-012271] [InnoDB] The innodb_system data file 'ibdata1' must be writable
2024-12-04T02:35:42.890891Z 1 [ERROR] [MY-012278] [InnoDB] The innodb_system data file 'ibdata1' must be writable
2024-12-04T02:35:42.892143Z 1 [ERROR] [MY-010334] [Server] Failed to initialize DD Storage Engine
2024-12-04T02:35:42.892389Z 0 [ERROR] [MY-010020] [Server] Data Dictionary initialization failed.
2024-12-04T02:35:42.893971Z 0 [ERROR] [MY-010119] [Server] Aborting
2024-12-04T02:35:42.901743Z 0 [System] [MY-010910] [Server] C:\Users\me\AppData\Roaming\Local\lightning-services\mysql-8.0.16+6\bin\win64\bin\mysqld.exe: Shutdown complete (mysqld 8.0.16) MySQL Community Server - GPL.

```

---

<div class="post-metadata">

**Author:** ![Nick-B](https://sea1.discourse-cdn.com/flex019/user_avatar/community.localwp.com/nick-b/32/16140_2.png) [@Nick-B](https://community.localwp.com/u/Nick-B)\
**Post date:** [December 4, 2024, 1:29pm UTC](https://community.localwp.com/t/mysql-configuration-where-to-edit/45619/4 "2024-12-04T13:29:28Z")

</div>

Hi @EvgeniyO - Could you provide a copy of your full Local Logs so we can see if anything stands out in there?

[Retrieving Local’s Log File](https://localwp.com/help-docs/troubleshooting/retrieving-locals-log-file/#download-local-logs)

---

<div class="post-metadata">

**Author:** ![EvgeniyO](https://avatars.discourse-cdn.com/v4/letter/e/6de8d8/32.png) [@EvgeniyO](https://community.localwp.com/u/EvgeniyO)\
**Post date:** [December 5, 2024, 10:18am UTC](https://community.localwp.com/t/mysql-configuration-where-to-edit/45619/5 "2024-12-05T10:18:12Z")

</div>

@Nick-B solved!

For other interested:

LocalWP has not two, but three configuration files, used by MySQL! Two of them I mentioned above - but the third, and most important one, works for all databases, managed by AdminerEvo. It is placed under

`../Local Sites/your_site/conf/mysql/my.cnf.hbs`

**Only editing of this file** makes effect on the whole MySQL configuration!

---

<div class="post-metadata">

**Author:** ![Nick-B](https://sea1.discourse-cdn.com/flex019/user_avatar/community.localwp.com/nick-b/32/16140_2.png) [@Nick-B](https://community.localwp.com/u/Nick-B)\
**Post date:** [December 5, 2024, 1:29pm UTC](https://community.localwp.com/t/mysql-configuration-where-to-edit/45619/6 "2024-12-05T13:29:12Z")

</div>


