Solved MySQL won't start after update

FreeBSD 14.4
MySQL 8.4.11

I did an update to mysql-server this morning and duly tried to restart mysql-server. However it wouldn't start. Looking at the MySQL logs I have this ...

Code:
[ERROR] [MY-011906] [InnoDB] Database page corruption on disk or a failed file read of page [page id: space=4294967279, page number=290]. You may have to recover from a backup.

InnoDB: End of page dump
InnoDB: Page may be an insert undo log page

I have no idea what has happened but I did restart the server and checked the hard drive which did find a few things and were corrected.

How on earth do I reset/initialize MySQL properly. I've seen so may different ways when Googling.

I have backups of the databases.
 
Did you just upgrade the binaries without anything else? Because that's a potential recipe for disaster, depending on the type of upgrade; at the very least look into mysql_upgrade.
 
I also found this in the MySQL log after setting
Code:
innodb_force_recovery=0
again ...

Code:
stack_bottom = 0 thread_stack 0x100000
 #0 0x257be5d <unknown>
 #1 0x257bff9 _Z15my_server_abortv
 #2 0x3154659 _Z8my_abortv
 #3 0x3543225 _Z23ut_dbg_assertion_failedPKcS0_m
 #4 0x3545f02 _ZN2ib5fatalD1Ev
 #5 0x3231652 _ZN9Buf_fetchI16Buf_fetch_normalE9read_pageEv
 #6 0x3230f87 _ZN16Buf_fetch_normal3getERP11buf_block_t
 #7 0x32326d7 _ZN9Buf_fetchI16Buf_fetch_normalE11single_pageEv
 #8 0x32325b2 _Z16buf_page_get_genRK9page_id_tRK11page_size_tmP11buf_block_t10Page_fetchN2ut8LocationEP5mtr_tb
 #9 0x35403cb _Z19trx_undo_lists_initP10trx_rseg_t
 #10 0x352a1e7 _Z20trx_rseg_init_threadPvm
 #11 0x352f1ec _ZN15Detached_threadclIPFvPvmEJS1_mEEEvOT_DpOT0_
 #12 0x352f0fe <unknown>
 #13 0x803c38e21 <unknown>
 
AI's answer , use it at own risk :),


How to Fix MySQL InnoDB Page Corruption (MY-011906) after FreeBSD Update

If a FreeBSD system update causes MySQL to crash with an InnoDB insert undo log page corruption error, the database will continuously auto-crash to prevent data corruption.

The Error Log Context:
Code:
[ERROR] [MY-011906] [InnoDB] Database page corruption on disk or a failed file read of page [page id: space=4294967279, page number=290]. You may have to recover from a backup.
InnoDB: End of page dump
InnoDB: Page may be an insert undo log page

Because the corruption is located within the internal undo log tablespace rather than a standard data table, standard REPAIR TABLE commands will not work. Here is the step-by-step process to safely isolate, extract, and restore the databases on a FreeBSD environment.

Step 1: Create a Physical Raw Backup​

Before running any recovery attempts, stop the service and make a complete copy of the raw database directory to protect the remaining data files.
Bash:
# Stop the MySQL service
service mysql-server stop

# Create a safety backup copy of the data directory
cp -R /var/db/mysql /var/db/mysql_corrupted_backup

Step 2: Force Read-Only Recovery Mode​

Instruct InnoDB to bypass the corrupted undo log segment so the MySQL daemon can stay online long enough to export the schemas.
1. Open the MySQL configuration file:
Bash:
ee /usr/local/etc/mysql/my.cnf
2. Add the recovery flag under the [mysqld] section starting at level 1:
INI:
[mysqld]
innodb_force_recovery = 1
3. Attempt to start the server:
Bash:
service mysql-server start
*Note: If the server continues to crash with the same error, open my.cnf again and increment innodb_force_recovery to 2, 3, or up to 4 until the service successfully remains active.*

Step 3: Export a Clean Logical Dump​

Once MySQL boots under the force recovery flag, it will operate in a strict read-only state. Immediately run a full logical export of all data.
Bash:
# Generate a complete SQL backup file
mysqldump -u root -p --all-databases --routines --triggers --single-transaction > /root/all_databases_backup.sql
Verify that the output file finishes successfully and contains data before moving to the next step.

Step 4: Wipe and Re-Initialize the MySQL Directory​

To clear out the underlying corruption in the InnoDB system files, the active data directory must be entirely reset.
1. Stop the recovery instance and remove the temporary configurations:
Bash:
service mysql-server stop
ee /usr/local/etc/mysql/my.cnf
2. Remove or comment out the recovery line:
INI:
# innodb_force_recovery = 1
3. Clear the corrupted active directory and re-initialize a fresh database space:
Bash:
rm -rf /var/db/mysql/*
mysqld --initialize --user=mysql
service mysql-server start

Step 5: Import the Clean Data​

With a healthy, uncorrupted database environment running, pipe the logical SQL backup file back into the system:
Bash:
mysql -u root -p < /root/all_databases_backup.sql
Once the import completes, restart the server normally. The error logs will clear, and the databases will return to full read/write functionality.
 
it was created by,
/home/x/hugging/16/Qwen3.6-35B-A3B-UD-IQ4_XS.gguf
Selected Model: Qwen3.6-35B-A3B-UD-IQ4_XS
Launching llama-server in the background...
[Llama Server Debug] Spawning command: llama-server --cpu-moe --model /home/x/hugging/16/Qwen3.6-35B-A3B-UD-IQ4_XS.gguf --ctx-size 32768 --batch-size 512 --verbose --ubatch-size 1024 --threads 6 --threads-batch 10 --temp 0.3 --parallel 1 --n-gpu-layers all --host 127.0.0.1 --port 8123 --no-warmup --jinja --no-mmap --fit off --cache-ram 4096 --kv-unified --no-warmup --parallel 1
 
When I upgraded MySQL last time I had same problems with starting server. Because MySQL installed default conf file from pkg, so after recovering my conf file server started as usual.
 
Back
Top