Skip to main content

Best way to keep MySQL in safe mode

Comments

3 comments

  • cPRex Jurassic Moderator

    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?

    https://support.cpanel.net/hc/en-us/articles/360050089274-How-to-change-the-SQL-mode-in-MySQL-or-MariaDB

    0
  • WCAndrew

    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
  • WCAndrew

    Update:

    I've changed this now to:
    sql_mode = 'NO_ENGINE_SUBSTITUTION'

    0

Please sign in to leave a comment.