Skip to content

Add persistent MySQL sql-mode configuration#2

Draft
Copilot wants to merge 2 commits intomainfrom
copilot/add-persistent-sql-mode-config
Draft

Add persistent MySQL sql-mode configuration#2
Copilot wants to merge 2 commits intomainfrom
copilot/add-persistent-sql-mode-config

Conversation

Copy link
Contributor

Copilot AI commented Dec 9, 2025

MySQL sql-mode settings were not persisting across service restarts, requiring manual configuration after each reboot.

Changes

  • Create /etc/mysql/mysql.conf.d/bhima.cnf during installation with STRICT_ALL_TABLES and NO_UNSIGNED_SUBTRACTION modes
  • Change systemctl start to systemctl restart to apply configuration immediately
# Add sql-mode to MySQL config so it persists across reboots
cat >/etc/mysql/mysql.conf.d/bhima.cnf <<EOF
[mysqld]
sql-mode='STRICT_ALL_TABLES,NO_UNSIGNED_SUBTRACTION'
EOF

systemctl restart mysql

The configuration now survives MySQL and system restarts without manual intervention.

Original prompt

Modify install/install.sh to configure a persistent sql-mode for MySQL.

In the install_mysql function:

  1. Locate the section where the MySQL service is enabled and started (around line 105).
  2. Before starting/restarting the service, create a configuration file at /etc/mysql/mysql.conf.d/bhima.cnf with the following content:
    [mysqld]
    sql-mode='STRICT_ALL_TABLES,NO_UNSIGNED_SUBTRACTION'
  3. Ensure the MySQL service is restarted (systemctl restart mysql) so the configuration takes effect immediately.

The resulting code block in install_mysql should look similar to:

  # Start and enable MySQL
  systemctl enable mysql

  # Add sql-mode to MySQL config so it persists across reboots
  cat >/etc/mysql/mysql.conf.d/bhima.cnf <<EOF
[mysqld]
sql-mode='STRICT_ALL_TABLES,NO_UNSIGNED_SUBTRACTION'
EOF

  systemctl restart mysql

This pull request was created as a result of the following prompt from Copilot chat.

Modify install/install.sh to configure a persistent sql-mode for MySQL.

In the install_mysql function:

  1. Locate the section where the MySQL service is enabled and started (around line 105).
  2. Before starting/restarting the service, create a configuration file at /etc/mysql/mysql.conf.d/bhima.cnf with the following content:
    [mysqld]
    sql-mode='STRICT_ALL_TABLES,NO_UNSIGNED_SUBTRACTION'
  3. Ensure the MySQL service is restarted (systemctl restart mysql) so the configuration takes effect immediately.

The resulting code block in install_mysql should look similar to:

  # Start and enable MySQL
  systemctl enable mysql

  # Add sql-mode to MySQL config so it persists across reboots
  cat >/etc/mysql/mysql.conf.d/bhima.cnf <<EOF
[mysqld]
sql-mode='STRICT_ALL_TABLES,NO_UNSIGNED_SUBTRACTION'
EOF

  systemctl restart mysql

💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.

Co-authored-by: jniles <896472+jniles@users.noreply.github.com>
Copilot AI changed the title [WIP] Add persistent sql-mode configuration for MySQL Add persistent MySQL sql-mode configuration Dec 9, 2025
Copilot AI requested a review from jniles December 9, 2025 18:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants