When upgrading mysql 8 and the mysql data dir is a restore from xtrabackup I’m running into some issues
After upgrading mysql the error log looks like this
2024-07-17T11:32:26.071558Z 0 [System] [MY-010116] [Server] /usr/sbin/mysqld (mysqld 8.0.38) starting as process 1245402
2024-07-17T11:32:26.090694Z 1 [System] [MY-013576] [InnoDB] InnoDB initialization has started.
2024-07-17T11:32:27.215687Z 1 [System] [MY-013577] [InnoDB] InnoDB initialization has ended.
2024-07-17T11:32:27.356228Z 1 [Warning] [MY-012351] [InnoDB] Tablespace 1, name 'sys/sys_config', file './sys/sys_config.ibd' is missing!
2024-07-17T11:32:28.020449Z 4 [System] [MY-013381] [Server] Server upgrade from '80036' to '80038' started.
2024-07-17T11:32:44.563061Z 4 [ERROR] [MY-012592] [InnoDB] Operating system error number 2 in a file operation.
2024-07-17T11:32:44.563232Z 4 [ERROR] [MY-012593] [InnoDB] The error means the system cannot find the path specified.
2024-07-17T11:32:44.563267Z 4 [ERROR] [MY-012216] [InnoDB] Cannot open datafile for read-only: './sys/sys_config.ibd' OS error: 71
2024-07-17T11:32:44.563517Z 4 [Warning] [MY-012049] [InnoDB] Cannot calculate statistics for table `sys`.`sys_config` because the .ibd file is missing. Please refer to http://dev.mysql.com/doc/refman/8.0/en/innodb-troubleshooting.html for how to resolve the issue.
2024-07-17T11:32:44.563768Z 4 [ERROR] [MY-013178] [Server] Execution of server-side SQL statement '-- Copyright (c) 2014, 2024, Oracle and/or its affiliates. -- -- This program is free software; you can redistribute it and/or modify -- it under the terms of the GNU General Public License as published by -- the Free Software Foundation; version 2 of the License. -- -- This program is distributed in the hope that it will be useful, -- but WITHOUT ANY WARRANTY; without even the implied warranty of -- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -- GNU General Public License for more details. -- -- You should have received a copy of the GNU General Public License -- along with this program; if not, write to the Free Software -- Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA -- -- Table: sys_config -- -- Stores configuration options for sys objects -- CREATE TABLE IF NOT EXISTS sys_config ( variable VARCHAR(128) PRIMARY KEY, value VARCHAR(128), set_time TIMESTAMP DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, set_by VARCHAR(128) ) ENGINE = InnoDB; ' failed with error code = 1812, error message = 'Tablespace is missing for table `sys`.`sys_config`.'.
2024-07-17T11:32:44.574825Z 0 [ERROR] [MY-013380] [Server] Failed to upgrade server.
2024-07-17T11:32:44.574906Z 0 [ERROR] [MY-010119] [Server] Aborting
The way I created the backup file was like this, where I didn’t include the sys
folder
xtrabackup --backup --user=root --password=xxx --databases="mydb mysql" --stream=xbstream --compress --target-dir=./ 2> backup.log 1> backup.xbstream
I guess I should include both performance_schema
and sys
like this?
xtrabackup --backup --user=root --password=xxx --databases="mydb mysql performance_schema sys" --stream=xbstream --compress --target-dir=./ 2> backup.log 1> backup.xbstream
Or is it even necessary to add performance_schema
to the backup?