docker-library / mysql

Docker Official Image packaging for MySQL Community Server
https://dev.mysql.com/
GNU General Public License v2.0
2.47k stars 2.2k forks source link

Container keeps Restaring #1007

Closed f908 closed 1 year ago

f908 commented 1 year ago
2023-11-01T03:48:44.104653Z 0 [System] [MY-010116] [Server] /usr/sbin/mysqld (mysqld 8.0.35) starting as process 1
2023-11-01T03:48:44.132753Z 1 [System] [MY-013576] [InnoDB] InnoDB initialization has started.
2023-11-01T03:48:44.900288Z 1 [ERROR] [MY-014061] [InnoDB] Invalid MySQL server downgrade: Cannot downgrade from 80200 to 80035. Downgrade is only permitted between patch releases.
mysqld: Can't open file: 'mysql.ibd' (errno: 0 - )
2023-11-01T03:48:45.221705Z 1 [ERROR] [MY-010334] [Server] Failed to initialize DD Storage Engine
2023-11-01T03:48:45.222491Z 0 [ERROR] [MY-010020] [Server] Data Dictionary initialization failed.
2023-11-01T03:48:45.222596Z 0 [ERROR] [MY-010119] [Server] Aborting
2023-11-01T03:48:45.223613Z 0 [System] [MY-010910] [Server] /usr/sbin/mysqld: Shutdown complete (mysqld 8.0.35)  MySQL Community Server - GPL.
2023-11-01 03:48:46+00:00 [Note] [Entrypoint]: Entrypoint script for MySQL Server 8.0.35-1.el8 started.
2023-11-01 03:48:47+00:00 [Note] [Entrypoint]: Switching to dedicated user 'mysql'
2023-11-01 03:48:47+00:00 [Note] [Entrypoint]: Entrypoint script for MySQL Server 8.0.35-1.el8 started.
'/var/lib/mysql/mysql.sock' -> '/var/run/mysqld/mysqld.sock'
2023-11-01T03:48:48.478140Z 0 [Warning] [MY-011068] [Server] The syntax '--skip-host-cache' is deprecated and will be removed in a future release. Please use SET GLOBAL host_cache_size=0 instead.
2023-11-01T03:48:48.481542Z 0 [System] [MY-010116] [Server] /usr/sbin/mysqld (mysqld 8.0.35) starting as process 1
2023-11-01T03:48:48.499976Z 1 [System] [MY-013576] [InnoDB] InnoDB initialization has started.
2023-11-01T03:48:49.228992Z 1 [ERROR] [MY-014061] [InnoDB] Invalid MySQL server downgrade: Cannot downgrade from 80200 to 80035. Downgrade is only permitted between patch releases.
mysqld: Can't open file: 'mysql.ibd' (errno: 0 - )
2023-11-01T03:48:49.583114Z 1 [ERROR] [MY-010334] [Server] Failed to initialize DD Storage Engine
2023-11-01T03:48:49.583758Z 0 [ERROR] [MY-010020] [Server] Data Dictionary initialization failed.
2023-11-01T03:48:49.584107Z 0 [ERROR] [MY-010119] [Server] Aborting
2023-11-01T03:48:49.585252Z 0 [System] [MY-010910] [Server] /usr/sbin/mysqld: Shutdown complete (mysqld 8.0.35)  MySQL Community Server - GPL.
2023-11-01 03:48:51+00:00 [Note] [Entrypoint]: Entrypoint script for MySQL Server 8.0.35-1.el8 started.
2023-11-01 03:48:51+00:00 [Note] [Entrypoint]: Switching to dedicated user 'mysql'
2023-11-01 03:48:52+00:00 [Note] [Entrypoint]: Entrypoint script for MySQL Server 8.0.35-1.el8 started.
'/var/lib/mysql/mysql.sock' -> '/var/run/mysqld/mysqld.sock'
2023-11-01T03:48:52.948560Z 0 [Warning] [MY-011068] [Server] The syntax '--skip-host-cache' is deprecated and will be removed in a future release. Please use SET GLOBAL host_cache_size=0 instead.
2023-11-01T03:48:52.951963Z 0 [System] [MY-010116] [Server] /usr/sbin/mysqld (mysqld 8.0.35) starting as process 1
2023-11-01T03:48:52.972128Z 1 [System] [MY-013576] [InnoDB] InnoDB initialization has started.
2023-11-01T03:48:53.591062Z 1 [ERROR] [MY-014061] [InnoDB] Invalid MySQL server downgrade: Cannot downgrade from 80200 to 80035. Downgrade is only permitted between patch releases.
mysqld: Can't open file: 'mysql.ibd' (errno: 0 - )
2023-11-01T03:48:54.065923Z 1 [ERROR] [MY-010334] [Server] Failed to initialize DD Storage Engine
2023-11-01T03:48:54.066408Z 0 [ERROR] [MY-010020] [Server] Data Dictionary initialization failed.
2023-11-01T03:48:54.066473Z 0 [ERROR] [MY-010119] [Server] Aborting
2023-11-01T03:48:54.067494Z 0 [System] [MY-010910] [Server] /usr/sbin/mysqld: Shutdown complete (mysqld 8.0.35)  MySQL Community Server - GPL.
2023-11-01 03:48:56+00:00 [Note] [Entrypoint]: Entrypoint script for MySQL Server 8.0.35-1.el8 started.
2023-11-01 03:48:57+00:00 [Note] [Entrypoint]: Switching to dedicated user 'mysql'
2023-11-01 03:48:57+00:00 [Note] [Entrypoint]: Entrypoint script for MySQL Server 8.0.35-1.el8 started.
'/var/lib/mysql/mysql.sock' -> '/var/run/mysqld/mysqld.sock'
2023-11-01T03:48:58.775531Z 0 [Warning] [MY-011068] [Server] The syntax '--skip-host-cache' is deprecated and will be removed in a future release. Please use SET GLOBAL host_cache_size=0 instead.
2023-11-01T03:48:58.779041Z 0 [System] [MY-010116] [Server] /usr/sbin/mysqld (mysqld 8.0.35) starting as process 1
2023-11-01T03:48:58.802998Z 1 [System] [MY-013576] [InnoDB] InnoDB initialization has started.
yosifkit commented 1 year ago
Invalid MySQL server downgrade: Cannot downgrade from 80200 to 80035

It looks like you ran your database files with mysql:8.2.0 (currently also tagged as 8.2, 8, innovation, latest, 8.2.0-oracle, 8.2-oracle, 8-oracle, innovation-oracle, oracle) and then tried to run them with mysql:8.0.35 (tagged as 8.0, 8.0.35-oracle, 8.0-oracle). From the mysqld error and the release notes this isn't a supported direction:

Downgrade from MySQL 8.2 to MySQL 8.1, or from a MySQL 8.2 release to a previous MySQL 8.2 release, is not supported. The only supported alternative is to restore a backup taken before upgrading. It is therefore imperative that you back up your data before starting the upgrade process.

- https://dev.mysql.com/doc/relnotes/mysql/8.2/en/

If you have important data and want to go back to MySQL 8.0, then you'll might be able to dump it while running 8.2 and then restore to a fresh 8.0 instance (not sure if that works). Alternatively, you could just stay on 8.2 and update your docker run line or docker-compose.yml file to a specific MySQL version.

f908 commented 1 year ago
Invalid MySQL server downgrade: Cannot downgrade from 80200 to 80035

It looks like you ran your database files with mysql:8.2.0 (currently also tagged as 8.2, 8, innovation, latest, 8.2.0-oracle, 8.2-oracle, 8-oracle, innovation-oracle, oracle) and then tried to run them with mysql:8.0.35 (tagged as 8.0, 8.0.35-oracle, 8.0-oracle). From the mysqld error and the release notes this isn't a supported direction:

Downgrade from MySQL 8.2 to MySQL 8.1, or from a MySQL 8.2 release to a previous MySQL 8.2 release, is not supported. The only supported alternative is to restore a backup taken before upgrading. It is therefore imperative that you back up your data before starting the upgrade process.

If you have important data and want to go back to MySQL 8.0, then you'll might be able to dump it while running 8.2 and then restore to a fresh 8.0 instance (not sure if that works). Alternatively, you could just stay on 8.2 and update your docker run line or docker-compose.yml file to a specific MySQL version.

Thanks, closing now