About a month ago, I installed WordPress and a Mysql database on an AWS EC2 instance. However, today I received the error “Error establishing a database connection”
When I connected to the instance, I saw that the status of the mysql service is “Server upgrade in progress” and additional logs
Aug 06 16:20:10 ip-172-31-10-42 systemd[1]: mysql.service: Main process exited, code=exited, status=1/FAILURE
Aug 06 16:20:10 ip-172-31-10-42 systemd[1]: mysql.service: Failed with result 'exit-code'.
Aug 06 16:20:10 ip-172-31-10-42 systemd[1]: Failed to start mysql.service - MySQL Community Server.
Going to the error.log file I found the following detailed logs
2024-08-06T00:00:24.778879Z 0 [System] [MY-010116] [Server] /usr/sbin/mysqld (mysqld 8.0.39-0ubuntu0.24.04.1) starting as process 140313
2024-08-06T00:00:24.788552Z 1 [System] [MY-013576] [InnoDB] InnoDB initialization has started.
2024-08-06T00:00:27.898906Z 1 [System] [MY-013577] [InnoDB] InnoDB initialization has ended.
2024-08-06T00:00:30.337578Z 4 [System] [MY-013381] [Server] Server upgrade from '80037' to '80039' started.
2024-08-06T00:01:20.397006Z 4 [ERROR] [MY-013178] [Server] Execution of server-side SQL statement 'EXECUTE stmt; ' failed with error code = 1205, error message = 'Lock wait timeout exceeded; try restarting transaction'.
2024-08-06T00:01:20.398571Z 0 [ERROR] [MY-013380] [Server] Failed to upgrade server.
2024-08-06T00:01:20.398661Z 0 [ERROR] [MY-010119] [Server] Aborting
I found information that mysql can initiate some “security updates” on its own and this could have caused this error. I also found ways to suspend these updates to access the data in the database, but is there any way to restore the current database without reinstalling it and restoring the data from the dump?