Home Explore Blog CI



nixpkgs

5th chunk of `nixos/doc/manual/release-notes/rl-2009.section.md`
bfcc2bbb9ec08c27cdd4a216b3952552ab494f127813dd0f0000000100000fd2
- MariaDB has been updated to 10.4, MariaDB Galera to 26.4. Before you upgrade, it would be best to take a backup of your database. For MariaDB Galera Cluster, see [Upgrading from MariaDB 10.3 to MariaDB 10.4 with Galera Cluster](https://mariadb.com/kb/en/upgrading-from-mariadb-103-to-mariadb-104-with-galera-cluster/) instead. Before doing the upgrade read [Incompatible Changes Between 10.3 and 10.4](https://mariadb.com/kb/en/upgrading-from-mariadb-103-to-mariadb-104/#incompatible-changes-between-103-and-104). After the upgrade you will need to run `mysql_upgrade`. MariaDB 10.4 introduces a number of changes to the authentication process, intended to make things easier and more intuitive. See [Authentication from MariaDB 10.4](https://mariadb.com/kb/en/authentication-from-mariadb-104/). unix_socket auth plugin does not use a password, and uses the connecting user's UID instead. When a new MariaDB data directory is initialized, two MariaDB users are created and can be used with new unix_socket auth plugin, as well as traditional mysql_native_password plugin: root\@localhost and mysql\@localhost. To actually use the traditional mysql_native_password plugin method, one must run the following:

  ```nix
  {
  services.mysql.initialScript = pkgs.writeText "mariadb-init.sql" ''
    ALTER USER root@localhost IDENTIFIED VIA mysql_native_password USING PASSWORD("verysecret");
  '';
  }
  ```

  When MariaDB data directory is just upgraded (not initialized), the users are not created or modified.

- MySQL server is now started with additional systemd sandbox/hardening options for better security. The PrivateTmp, ProtectHome, and ProtectSystem options may be problematic when MySQL is attempting to read from or write to your filesystem anywhere outside of its own state directory, for example when calling `LOAD DATA INFILE or SELECT * INTO OUTFILE`. In this scenario a variant of the following may be required: - allow MySQL to read from /home and /tmp directories when using `LOAD DATA INFILE`

  ```nix
  {
    systemd.services.mysql.serviceConfig.ProtectHome = lib.mkForce "read-only";
  }
  ```

  \- allow MySQL to write to custom folder `/var/data` when using `SELECT * INTO OUTFILE`, assuming the mysql user has write access to `/var/data`

  ```nix
  {
    systemd.services.mysql.serviceConfig.ReadWritePaths = [ "/var/data" ];
  }
  ```

  The MySQL service no longer runs its `systemd` service startup script as `root` anymore. A dedicated non `root` super user account is required for operation. This means users with an existing MySQL or MariaDB database server are required to run the following SQL statements as a super admin user before upgrading:

  ```SQL
  CREATE USER IF NOT EXISTS 'mysql'@'localhost' identified with unix_socket;
  GRANT ALL PRIVILEGES ON *.* TO 'mysql'@'localhost' WITH GRANT OPTION;
  ```

  If you use MySQL instead of MariaDB please replace `unix_socket` with `auth_socket`. If you have changed the value of [services.mysql.user](options.html#opt-services.mysql.user) from the default of `mysql` to a different user please change `'mysql'@'localhost'` to the corresponding user instead.

- Zabbix now defaults to 5.0, updated from 4.4. Please carefully read through [the upgrade guide](https://www.zabbix.com/documentation/current/manual/installation/upgrade/sources) and apply any changes required. Be sure to take special note of the section on [enabling extended range of numeric (float) values](https://www.zabbix.com/documentation/current/manual/installation/upgrade_notes_500#enabling_extended_range_of_numeric_float_values) as you will need to apply this database migration manually.

  If you are using Zabbix Server with a MySQL or MariaDB database you should note that using a character set of `utf8` and a collate of `utf8_bin` has become mandatory with this release. See the upstream [issue](https://support.zabbix.com/browse/ZBX-17357) for further discussion. Before upgrading you should check the character set and collation used by your database and ensure they are correct:

Title: Release 20.09 - MariaDB/MySQL and Zabbix Upgrade Notes
Summary
This section details important changes and upgrade steps for MariaDB/MySQL and Zabbix in NixOS 20.09. For MariaDB, it covers version updates, database backup recommendations, authentication changes, and provides a configuration example. For MySQL, it discusses systemd sandbox settings affecting file access and mandates SQL statements to adjust user privileges due to a change in service startup user. Lastly, for Zabbix, it highlights the upgrade to version 5.0, referencing the official upgrade guide, emphasizing the manual database migration for numeric values, and mandating the use of 'utf8' character set and 'utf8_bin' collation for MySQL/MariaDB databases.