Skip to main content

Apply configuration manually for MySQL

Choose the environment that hosts MySQL. Review the MySQL permissions and the shared pre-change, verification, and recovery checks before you begin.

Before you begin​

Confirm the active MySQL configuration directory, record the current settings, and plan a maintenance window and recovery path. If the destination already contains z_aiops_mysql.cnf, make a backup copy outside the active include directory. If it does not, record that the Releem file is new. The Releem Agent stores the Recommended Configuration at /opt/releem/conf/z_aiops_mysql.cnf.

On Debian and Ubuntu systems, copy the generated file to /etc/mysql/conf.d/:

cp /opt/releem/conf/z_aiops_mysql.cnf /etc/mysql/conf.d/
info

CentOS uses the alternate directory /etc/my.cnf.d/. Confirm the active include directory before copying the file.

Step 2: Restart MySQL to apply configuration​

Review the copied settings, then restart the database during the planned maintenance window. If you use MySQL 5.6.7 or earlier and the recommendation changes innodb_log_file_size, follow the special procedure below instead of this restart command.

service mysqld restart

Special case: MySQL 5.6.7 or earlier with an innodb_log_file_size change​

InnoDB redo logs store changes used during crash recovery. For this version range, changing their size requires a clean shutdown and moving the old files before startup. See Changing the Number or Size of Redo Log Files in the MySQL 5.6 manual.

Before you begin, have a recoverable database backup and the previous configuration. Confirm the service name, log directory (innodb_log_group_home_dir, or datadir when unset), and number of log files (innodb_log_files_in_group). The examples use the mysql service and two files in /var/lib/mysql; use your actual service, directory, and complete file list.

  1. Set the shutdown mode so MySQL flushes pending changes:
mysql -e "SET GLOBAL innodb_fast_shutdown = 1"

Use your administrator account. If it requires a password, open mysql -u root -p and run the same SET GLOBAL statement at the MySQL prompt.

  1. Stop MySQL:
service mysql stop

Confirm that the server has stopped and its error log reports shutdown without errors. Do not move log files after a failed or forced shutdown.

  1. Move the old log files into an existing, empty backup directory outside the data directory. Replace the placeholder with its absolute path:
mv /var/lib/mysql/ib_logfile0 /var/lib/mysql/ib_logfile1 [BACKUP_DIRECTORY]/
  1. Start MySQL with the recommended configuration:
service mysql start

MySQL creates new redo logs at the configured size. Keep the old files until verification completes. If startup fails, inspect the error log before retrying; do not overwrite newly created logs with old ones. Use your database backup and recovery procedure if required.

Step 3: Verify the Applied Configuration​

  1. Check whether any settings remain restart-pending and confirm the effective database settings in MySQL. For the redo-log change above, check SHOW GLOBAL VARIABLES LIKE 'innodb_log_file_size'; and inspect the error log for startup errors.
  2. Confirm the database service is running and review application connectivity and errors.
  3. Confirm the Applied recommended configuration event on the MySQL Metrics graph, then review current metrics.

If the service does not return to its expected state, restore the backed-up z_aiops_mysql.cnf or remove the newly inserted file from the active include directory, then restart MySQL. If that recovery fails, use Rollback when applicable and contact Releem support.