Upgrading MySQL from 5.7 to 8.0 was mostly uneventful.
Here are the steps I did.
- Stop the running 5.7 instance.
- Make ZFS snapshots of these three filesystems:
zfs snap email@example.com
zfs snap firstname.lastname@example.org
zfs snap email@example.com
- Upgrade to 8.0.
- Review the new
/usr/local/etc/mysql. In my case, my
my.cnfdiffers from the stock version in a couple of areas. See below.
- Start the 8.0 instance. Remember, the server will now automatically run the steps previously done using
mysql_upgrade. This first start will be significantly slower than the subsequent ones.
- I noticed “mysqlx” defaults to listening on
[::]and on TCP port
33060, which may be undesired. I adjusted
my.cnfaccordingly and restarted MySQL.
--- /usr/local/etc/mysql/my.cnf.sample 2023-05-01 20:34:17.000000000 +0200 +++ /usr/local/etc/mysql/my.cnf 2023-03-17 12:16:35.183671000 +0100 @@ -10,7 +13,9 @@ user = mysql port = 3306 socket = /tmp/mysql.sock -bind-address = 127.0.0.1 +bind-address = ::ffff:127.0.0.1 +mysqlx-port = 33060 +mysqlx-bind-address = ::ffff:127.0.0.1 basedir = /usr/local datadir = /var/db/mysql tmpdir = /var/db/mysql_tmpdir @@ -50,6 +55,7 @@ innodb_write_io_threads = 8 innodb_read_io_threads = 8 innodb_autoinc_lock_mode = 2 +innodb_file_per_table = ON [mysqldump] max_allowed_packet = 256M