Best way to keep MySQL in safe mode
On my new server (AlmaLinux 8) I need MySQL in safe mode.
I have edited the etc/my.cnf to add sql_mode="" at the bottom and that works.
But last night after some maintenance it has been changed and my edit has disappeared.
Is this still the best way to make sure my MySQL 8 database stays in safe mode? It always worked on my old cPanel server.
-
Hey there! Adding an empty sql_mode line likely isn't going to work since we want to ensure the default settings are kept in place while also making adjustments. Can you try using the information in this article to make that adjustment and see if that sticks?
0 -
Thanks. Another cPanel update has stopped my MySQL from restarting.
When I checked the last line it was just sql_mode (no equals sign or quote marks)
Now I have set it to:
sql_mode = 'ONLY_FULL_GROUP_BY,NO_ZERO_IN_DATE,NO_ZERO_DATE,ERROR_FOR_DIVISION_BY_ZERO,NO_ENGINE_SUBSTITUTION'That is from the link you sent but I have removed the STRICT_TRANS_TABLES bit because I need strict mode off.
When I restart MySQL I get a message:
=======================================
2024-07-01T10:46:25.311391Z 0 [ERROR] [MY-000071] [Server] /usr/sbin/mysqld: option '--sql_mode' requires an argument.
2024-07-01T10:44:51.380635Z 0 [ERROR] [MY-000071] [Server] /usr/sbin/mysqld: option '--sql_mode' requires an argument.mysql restarted successfully.
=======================================
Do you think the next update will work successfully for me?
0 -
Update:
I've changed this now to:
sql_mode = 'NO_ENGINE_SUBSTITUTION'0
Please sign in to leave a comment.
Comments
3 comments