mysqld service won't start

29.7k views Asked by At

After Fedora 28 decided to upgrade mysql-community packages to 8.0 (latest) ,I realized my application was failing and had to downgrade to mysql 5.27.2

Of course my db files (.idb) were the same (altered by mysql 8.0). When starting mysql 5.27 service, it fails. I have read the log file /var/log/mysqld.log and found this:

InnoDB: Table flags are 0 in the data dictionary but the flags in file ./ibdata1 are 0x4000!

2

There are 2 answers

8
julianm On

This problem was solved removing all database files:

 sudo rm -rf /var/lib/mysql/*

Please be aware you will lose every database in the server by doing this!!! In my case I had a dump and i could restore.

0
Abdurrahman Adebiyi On

Ensure you are using the MySQL version 8.0 client specifically to avoid this error

RCA 1.You attempted to start a newer version of mysql server with mysqld_safe(ver5) instead of the version 8.0

Solution

export MYSQL_8_HOME=/path/to/mysql-8.0.17-macos10.14-x86_64 #e.g /usr/local/mysql-8.0.17-macos10.14-x86_64
cd $MYSQL_8_HOME # where is the dorectory mysql v8.0 was installed.
bin/mysqld_safe --user=mysql --datadir=/path/to/data/mysql 

Just for added measure, you might consider updating your PATH variable to prefix it with the newer version of MySQL programs like this

export PATH=$MYSQL_HOME/bin:$PATH

before starting mysqld_safe