I use 0 for autocommit variable. I was surprised a bit to find that setting
SET global AUTOCOMMIT=0;
is valid only until service restart. Then I get default (1) value again. To make it persistent I wrote it into my.cfg/my.ini file. Now it works.
But I would like to ask possibility to set the variable usind "SET" command with some keyword to make it retentive.
1) what if there is no any config file?
2) what if there is write rights to the file?
3) command line option will still prevail, so it will be the same effect in case of command line options
4) allow server to write to setup looks (for me) like a security risk
Oleksandr Byelkin
added a comment - 1) what if there is no any config file?
2) what if there is write rights to the file?
3) command line option will still prevail, so it will be the same effect in case of command line options
4) allow server to write to setup looks (for me) like a security risk
I hope these questions are not for me.
But I can drop an opinion:
1) create the file and fill it
2) inform with "Unknown error" or something
3) that's OK if command line option prevail, it desired to work in no command line option mode like SET tells
4) the same user can drop tables, users, so it's OK for him to rule the settings of the database
Tadas Balaišis
added a comment - I hope these questions are not for me.
But I can drop an opinion:
1) create the file and fill it
2) inform with "Unknown error" or something
3) that's OK if command line option prevail, it desired to work in no command line option mode like SET tells
4) the same user can drop tables, users, so it's OK for him to rule the settings of the database
4) is about having code which rewrite config in the server.
5) rewriting confing is far from be atomic so you can just destroy config (tables looks way better at least aria are crash safe)
Oleksandr Byelkin
added a comment - 4) is about having code which rewrite config in the server.
5) rewriting confing is far from be atomic so you can just destroy config (tables looks way better at least aria are crash safe)
To answer sanja's questions according to how MySQL does it:
1) It creates a separate file, mysqld-auto.cnf
2) It doesn't attempt to write to any other config file, so this should not be an issue
3) No, until RESET PERSIST... is run, this takes precedence over options set on the command-line.
4) This is written in the data directory only
5) Agree, which is an argument for writing in a system table instead
Ian Gilfillan
added a comment - To answer sanja 's questions according to how MySQL does it:
1) It creates a separate file, mysqld-auto.cnf
2) It doesn't attempt to write to any other config file, so this should not be an issue
3) No, until RESET PERSIST... is run, this takes precedence over options set on the command-line.
4) This is written in the data directory only
5) Agree, which is an argument for writing in a system table instead
More info:
https://dev.mysql.com/doc/refman/8.0/en/persisted-system-variables.html
https://mysqlserverteam.com/mysql-8-0-persisting-configuration-variables/
https://www.percona.com/blog/2019/08/13/set-persist-in-mysql/
As far as I understand, the only practical effect of this MySQL feature on real-world environments is bringing uncertainty about the actual servers configuration. It allows to change a variable and make the change survive a restart without changing my.cnf: this is strictly against the modern way to handle systems (infrastructure as code paradigm, devops, SRE, whatever).
I agree that an SQL command should not modify a configuration file. That could even worsen the situation, because the actual configuration file on a server wouldn't match the one you have in your repository.
Please, don't implement this command or any variant.
Federico Razzoli
added a comment - As far as I understand, the only practical effect of this MySQL feature on real-world environments is bringing uncertainty about the actual servers configuration. It allows to change a variable and make the change survive a restart without changing my.cnf: this is strictly against the modern way to handle systems (infrastructure as code paradigm, devops, SRE, whatever).
I agree that an SQL command should not modify a configuration file. That could even worsen the situation, because the actual configuration file on a server wouldn't match the one you have in your repository.
Please, don't implement this command or any variant.
I use 0 for autocommit variable. I was surprised a bit to find that setting
SET global AUTOCOMMIT=0;
is valid only until service restart. Then I get default (1) value again. To make it persistent I wrote it into my.cfg/my.ini file. Now it works.
But I would like to ask possibility to set the variable usind "SET" command with some keyword to make it retentive.
I use 0 for autocommit variable. I was surprised a bit to find that setting
SET global AUTOCOMMIT=0;
is valid only until service restart. Then I get default (1) value again. To make it persistent I wrote it into my.cfg/my.ini file. Now it works.
But I would like to ask possibility to set the variable usind "SET" command with some keyword to make it retentive.
Even though it's unclear whether this will be implemented, since it's still open, I'm linking it to the parent list of MySQL-8 compatibility tasks.
Ian Gilfillan
added a comment - Even though it's unclear whether this will be implemented, since it's still open, I'm linking it to the parent list of MySQL-8 compatibility tasks.
We could have a special, always included 'persistent.cnf' file in that is modified with SET PERSISTENT ...
This would always be loaded last from my.cnf.
At least, the behavior of this feature would be easy to document and understand
Michael Widenius
added a comment - We could have a special, always included 'persistent.cnf' file in that is modified with SET PERSISTENT ...
This would always be loaded last from my.cnf.
At least, the behavior of this feature would be easy to document and understand
This would still cause inconsistencies between (for example) a user's Ansible repository and MariaDB configuration. Even if the repository contains persistent.cnf, it will be different from the one on the server.
Federico Razzoli
added a comment - This would still cause inconsistencies between (for example) a user's Ansible repository and MariaDB configuration. Even if the repository contains persistent.cnf, it will be different from the one on the server.
Michaël de groot
added a comment - Good configuration management overwrites 'unknown' configuration files like 'persistent.cnf', so this is compatible with what @monty proposed.
Check https://gitlab.com/de-groot-consultancy-ansible-roles/mariadb-mysql-galera/-/blob/beta/tasks/configure-mariadb.yml for an example.
People
Unassigned
Tadas Balaišis
Votes:
2Vote for this issue
Watchers:
14Start watching this issue
Dates
Created:
Updated:
Git Integration
Error rendering 'com.xiplink.jira.git.jira_git_plugin:git-issue-webpanel'. Please contact your Jira administrators.
{"report":{"fcp":1163.7999999523163,"ttfb":300.59999990463257,"pageVisibility":"visible","entityId":67657,"key":"jira.project.issue.view-issue","isInitial":true,"threshold":1000,"elementTimings":{},"userDeviceMemory":8,"userDeviceProcessors":64,"apdex":0.5,"journeyId":"47244da1-3dfa-4989-a6b0-7920ff7460cc","navigationType":0,"readyForUser":1217.7999999523163,"redirectCount":0,"resourceLoadedEnd":1386.5,"resourceLoadedStart":305.09999990463257,"resourceTiming":[{"duration":410.10000002384186,"initiatorType":"link","name":"https://jira.mariadb.org/s/2c21342762a6a02add1c328bed317ffd-CDN/lu2bu7/820016/12ta74/0a8bac35585be7fc6c9cc5a0464cd4cf/_/download/contextbatch/css/_super/batch.css","startTime":305.09999990463257,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":305.09999990463257,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":715.1999999284744,"responseStart":0,"secureConnectionStart":0},{"duration":410.10000002384186,"initiatorType":"link","name":"https://jira.mariadb.org/s/7ebd35e77e471bc30ff0eba799ebc151-CDN/lu2bu7/820016/12ta74/8679b4946efa1a0bb029a3a22206fb5d/_/download/contextbatch/css/jira.browse.project,project.issue.navigator,jira.view.issue,jira.general,jira.global,atl.general,-_super/batch.css?agile_global_admin_condition=true&jag=true&jira.create.linked.issue=true&slack-enabled=true","startTime":305.39999997615814,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":305.39999997615814,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":715.5,"responseStart":0,"secureConnectionStart":0},{"duration":419.7000000476837,"initiatorType":"script","name":"https://jira.mariadb.org/s/fbf975c0cce4b1abf04784eeae9ba1f4-CDN/lu2bu7/820016/12ta74/0a8bac35585be7fc6c9cc5a0464cd4cf/_/download/contextbatch/js/_super/batch.js?locale=en","startTime":305.59999990463257,"connectEnd":305.59999990463257,"connectStart":305.59999990463257,"domainLookupEnd":305.59999990463257,"domainLookupStart":305.59999990463257,"fetchStart":305.59999990463257,"redirectEnd":0,"redirectStart":0,"requestStart":305.59999990463257,"responseEnd":725.2999999523163,"responseStart":725.2999999523163,"secureConnectionStart":305.59999990463257},{"duration":476.2000000476837,"initiatorType":"script","name":"https://jira.mariadb.org/s/099b33461394b8015fc36c0a4b96e19f-CDN/lu2bu7/820016/12ta74/8679b4946efa1a0bb029a3a22206fb5d/_/download/contextbatch/js/jira.browse.project,project.issue.navigator,jira.view.issue,jira.general,jira.global,atl.general,-_super/batch.js?agile_global_admin_condition=true&jag=true&jira.create.linked.issue=true&locale=en&slack-enabled=true","startTime":305.6999999284744,"connectEnd":305.6999999284744,"connectStart":305.6999999284744,"domainLookupEnd":305.6999999284744,"domainLookupStart":305.6999999284744,"fetchStart":305.6999999284744,"redirectEnd":0,"redirectStart":0,"requestStart":305.6999999284744,"responseEnd":781.8999999761581,"responseStart":781.8999999761581,"secureConnectionStart":305.6999999284744},{"duration":479.60000002384186,"initiatorType":"script","name":"https://jira.mariadb.org/s/94c15bff32baef80f4096a08aceae8bc-CDN/lu2bu7/820016/12ta74/c92c0caa9a024ae85b0ebdbed7fb4bd7/_/download/contextbatch/js/atl.global,-_super/batch.js?locale=en","startTime":305.7999999523163,"connectEnd":305.7999999523163,"connectStart":305.7999999523163,"domainLookupEnd":305.7999999523163,"domainLookupStart":305.7999999523163,"fetchStart":305.7999999523163,"redirectEnd":0,"redirectStart":0,"requestStart":305.7999999523163,"responseEnd":785.3999999761581,"responseStart":785.3999999761581,"secureConnectionStart":305.7999999523163},{"duration":479.60000002384186,"initiatorType":"script","name":"https://jira.mariadb.org/s/d41d8cd98f00b204e9800998ecf8427e-CDN/lu2bu7/820016/12ta74/1.0/_/download/batch/jira.webresources:calendar-en/jira.webresources:calendar-en.js","startTime":306.09999990463257,"connectEnd":306.09999990463257,"connectStart":306.09999990463257,"domainLookupEnd":306.09999990463257,"domainLookupStart":306.09999990463257,"fetchStart":306.09999990463257,"redirectEnd":0,"redirectStart":0,"requestStart":306.09999990463257,"responseEnd":785.6999999284744,"responseStart":785.6999999284744,"secureConnectionStart":306.09999990463257},{"duration":479.7000000476837,"initiatorType":"script","name":"https://jira.mariadb.org/s/d41d8cd98f00b204e9800998ecf8427e-CDN/lu2bu7/820016/12ta74/1.0/_/download/batch/jira.webresources:calendar-localisation-moment/jira.webresources:calendar-localisation-moment.js","startTime":306.2999999523163,"connectEnd":306.2999999523163,"connectStart":306.2999999523163,"domainLookupEnd":306.2999999523163,"domainLookupStart":306.2999999523163,"fetchStart":306.2999999523163,"redirectEnd":0,"redirectStart":0,"requestStart":306.2999999523163,"responseEnd":786,"responseStart":786,"secureConnectionStart":306.2999999523163},{"duration":556.5,"initiatorType":"link","name":"https://jira.mariadb.org/s/b04b06a02d1959df322d9cded3aeecc1-CDN/lu2bu7/820016/12ta74/a2ff6aa845ffc9a1d22fe23d9ee791fc/_/download/contextbatch/css/jira.global.look-and-feel,-_super/batch.css","startTime":306.39999997615814,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":306.39999997615814,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":862.8999999761581,"responseStart":0,"secureConnectionStart":0},{"duration":556.3999999761581,"initiatorType":"link","name":"https://jira.mariadb.org/s/3ac36323ba5e4eb0af2aa7ac7211b4bb-CDN/lu2bu7/820016/12ta74/d176f0986478cc64f24226b3d20c140d/_/download/contextbatch/css/com.atlassian.jira.projects.sidebar.init,-_super,-project.issue.navigator,-jira.view.issue/batch.css?jira.create.linked.issue=true","startTime":306.6999999284744,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":306.6999999284744,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":863.0999999046326,"responseStart":0,"secureConnectionStart":0},{"duration":479.7000000476837,"initiatorType":"script","name":"https://jira.mariadb.org/rest/api/1.0/shortcuts/820016/47140b6e0a9bc2e4913da06536125810/shortcuts.js?context=issuenavigation&context=issueaction","startTime":306.6999999284744,"connectEnd":306.6999999284744,"connectStart":306.6999999284744,"domainLookupEnd":306.6999999284744,"domainLookupStart":306.6999999284744,"fetchStart":306.6999999284744,"redirectEnd":0,"redirectStart":0,"requestStart":306.6999999284744,"responseEnd":786.3999999761581,"responseStart":786.3999999761581,"secureConnectionStart":306.6999999284744},{"duration":480,"initiatorType":"script","name":"https://jira.mariadb.org/s/3339d87fa2538a859872f2df449bf8d0-CDN/lu2bu7/820016/12ta74/d176f0986478cc64f24226b3d20c140d/_/download/contextbatch/js/com.atlassian.jira.projects.sidebar.init,-_super,-project.issue.navigator,-jira.view.issue/batch.js?jira.create.linked.issue=true&locale=en","startTime":306.89999997615814,"connectEnd":306.89999997615814,"connectStart":306.89999997615814,"domainLookupEnd":306.89999997615814,"domainLookupStart":306.89999997615814,"fetchStart":306.89999997615814,"redirectEnd":0,"redirectStart":0,"requestStart":306.89999997615814,"responseEnd":786.8999999761581,"responseStart":786.8999999761581,"secureConnectionStart":306.89999997615814},{"duration":1067.4000000953674,"initiatorType":"script","name":"https://jira.mariadb.org/s/d41d8cd98f00b204e9800998ecf8427e-CDN/lu2bu7/820016/12ta74/1.0/_/download/batch/jira.webresources:bigpipe-js/jira.webresources:bigpipe-js.js","startTime":313.09999990463257,"connectEnd":313.09999990463257,"connectStart":313.09999990463257,"domainLookupEnd":313.09999990463257,"domainLookupStart":313.09999990463257,"fetchStart":313.09999990463257,"redirectEnd":0,"redirectStart":0,"requestStart":313.09999990463257,"responseEnd":1380.5,"responseStart":1380.5,"secureConnectionStart":313.09999990463257},{"duration":1068.4000000953674,"initiatorType":"script","name":"https://jira.mariadb.org/s/d41d8cd98f00b204e9800998ecf8427e-CDN/lu2bu7/820016/12ta74/1.0/_/download/batch/jira.webresources:bigpipe-init/jira.webresources:bigpipe-init.js","startTime":313.09999990463257,"connectEnd":313.09999990463257,"connectStart":313.09999990463257,"domainLookupEnd":313.09999990463257,"domainLookupStart":313.09999990463257,"fetchStart":313.09999990463257,"redirectEnd":0,"redirectStart":0,"requestStart":313.09999990463257,"responseEnd":1381.5,"responseStart":1381.5,"secureConnectionStart":313.09999990463257},{"duration":163.29999995231628,"initiatorType":"xmlhttprequest","name":"https://jira.mariadb.org/rest/webResources/1.0/resources","startTime":888.3999999761581,"connectEnd":888.3999999761581,"connectStart":888.3999999761581,"domainLookupEnd":888.3999999761581,"domainLookupStart":888.3999999761581,"fetchStart":888.3999999761581,"redirectEnd":0,"redirectStart":0,"requestStart":888.3999999761581,"responseEnd":1051.6999999284744,"responseStart":1051.6999999284744,"secureConnectionStart":888.3999999761581},{"duration":262.8000000715256,"initiatorType":"script","name":"https://jira.mariadb.org/s/d41d8cd98f00b204e9800998ecf8427e-CDN/lu2bu7/820016/12ta74/e65b778d185daf5aee24936755b43da6/_/download/contextbatch/js/browser-metrics-plugin.contrib,-_super,-project.issue.navigator,-jira.view.issue,-atl.general/batch.js?agile_global_admin_condition=true&jag=true&jira.create.linked.issue=true&slack-enabled=true","startTime":1123.6999999284744,"connectEnd":1123.6999999284744,"connectStart":1123.6999999284744,"domainLookupEnd":1123.6999999284744,"domainLookupStart":1123.6999999284744,"fetchStart":1123.6999999284744,"redirectEnd":0,"redirectStart":0,"requestStart":1123.6999999284744,"responseEnd":1386.5,"responseStart":1386.5,"secureConnectionStart":1123.6999999284744}],"fetchStart":0,"domainLookupStart":0,"domainLookupEnd":0,"connectStart":0,"connectEnd":0,"requestStart":50,"responseStart":301,"responseEnd":310,"domLoading":304,"domInteractive":1458,"domContentLoadedEventStart":1458,"domContentLoadedEventEnd":1504,"domComplete":1665,"loadEventStart":1665,"loadEventEnd":1665,"userAgent":"Mozilla/5.0 AppleWebKit/537.36 (KHTML, like Gecko; compatible; ClaudeBot/1.0; +claudebot@anthropic.com)","marks":[{"name":"bigPipe.sidebar-id.start","time":1419.6999999284744},{"name":"bigPipe.sidebar-id.end","time":1420.5},{"name":"bigPipe.activity-panel-pipe-id.start","time":1420.5999999046326},{"name":"bigPipe.activity-panel-pipe-id.end","time":1425.7999999523163},{"name":"activityTabFullyLoaded","time":1525.5999999046326}],"measures":[],"correlationId":"4bf747c613c320","effectiveType":"4g","downlink":9.3,"rtt":0,"serverDuration":153,"dbReadsTimeInMs":28,"dbConnsTimeInMs":38,"applicationHash":"9d11dbea5f4be3d4cc21f03a88dd11d8c8687422","experiments":[]}}
Added Compatibility label, as MySQL 8.0 has SET PERSIST (and SET PERSIST_ONLY).