Upgrading MySQL from 5.7 to 8.0 was mostly uneventful.

Here are the steps I did.

  1. Stop the running 5.7 instance.
  2. Make ZFS snapshots of these three filesystems:
    1. zfs snap enterprise_zdata/var/db/mysql@pre-8.0
    2. zfs snap enterprise_zdata/var/db/mysql_secure@pre-8.0
    3. zfs snap enterprise_zdata/var/db/mysql_tmpdir@pre-8.0
  3. Upgrade to 8.0.
  4. Review the new my.cnf.sample in /usr/local/etc/mysql. In my case, my my.cnf differs from the stock version in a couple of areas. See below.
  5. 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.
  6. I noticed “mysqlx” defaults to listening on [::] and on TCP port 33060, which may be undesired. I adjusted my.cnf accordingly 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

Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes:

<a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>