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?
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:
Edit the Active Configuration File (my.cnf):
Add the line:
event_scheduler = ON
Temporary Activation:
Run the SQL command manually if you need immediate activation (temporary until server restart):
SET GLOBAL event_scheduler = ON;
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.
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, 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:
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.
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!