0

I have a weird problem whereby every few weeks, changes I've made to MySQL config are being reset to their defaults.

I'm on Centos 7.9 and CPanel 98.0.9.

I'm making my changes via PHPMyAdmin while logged in as root. Example:

sql_mode=NO_ZERO_IN_DATE,NO_ZERO_DATE,ERROR_FOR_DIVISION_BY_ZERO,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION

Eventually this gets reverted to include something my CMS doesn't like, namely the STRICT_TRANS_TABLES property.

I spoke to support, who suggested I write the change to /etc/my.cnf instead, which I've now done. But I don't know if there's other places I should write this override so it doesn't get lost again.

I'm no server guy; does anyone know what might be doing this? Where would I go sniffing on the server to hopefully find out?

Thanks very much in advance.

  • How utterly ridiculous that this is closed, because my host (like zillions of hosts) uses control panel software. Presumably over on Stack Overflow questions on React should not be allowed because they extend and modify base JavaScript behaviour and questions. – user9540234 Oct 20 '21 at 18:29
  • I'm not in a position to vote on closing. This might have been a better fit on Unix&Linux. – doneal24 Oct 20 '21 at 18:56

1 Answers1

0

Changes made to the running daemon through the command line are transient and will not survive a restart. You received correct advice to edit /etc/my.cnf, or better put your changes in /etc/my.cnf.d/custom.cnf.

doneal24
  • 851
  • 6
  • 14
  • Thank you. Then what's the point of ever setting config variables via PHPMyAdmin if they're going to be lost once MySQL is restarted? – user9540234 Oct 20 '21 at 18:30
  • @user9540234 Useful for checking out configurations before setting the permanently. Rarely, it might be necessary for a one-off query. `PHPMyAdmin` is a useful end-user tool. Not so much for administration. – doneal24 Oct 20 '21 at 18:45
  • Thanks, appreciated. – user9540234 Oct 21 '21 at 09:51