docker 安装mysql 出现 :
2020-08-04T06:59:41.218218Z 0 [ERROR] [FATAL] InnoDB: Table flags are 0 in the data dictionary but the flags in file ./ibdata1 are 0x4800!
2020-08-04 06:59:41 0x7fd9063f2740 InnoDB: Assertion failure in thread 140570089432896 in file ut0ut.cc line 918
InnoDB: We intentionally generate a memory trap.
InnoDB: Submit a detailed bug report to http://bugs.mysql.com.
InnoDB: If you get repeated assertion failures or crashes, even
InnoDB: immediately after the mysqld startup, there may be
InnoDB: corruption in the InnoDB tablespace. Please refer to
InnoDB: http://dev.mysql.com/doc/refman/5.7/en/forcing-innodb-recovery.html
InnoDB: about forcing recovery.
06:59:41 UTC - mysqld got signal 6 ;
This could be because you hit a bug. It is also possible that this binary
or one of the libraries it was linked against is corrupt, improperly built,
or misconfigured. This error can also be caused by malfunctioning hardware.
Attempting to collect some information that could help diagnose the problem.
As this is a crash and something is definitely wrong, the information
collection process might fail.
出现的原因是 一开始我是用了 5.8 ,然后数据目录存了一些数据,我换成5,7的时候 没有把数据删掉,再重新启动的时候,数据目录还是指向原来的数据,版本的数据格式不一样, 清空 数据目录的数据,便可以启动了
[root@Git_Server mysql]# cd /var/lib/docker/volumes/mysql-vol
[root@Git_Server mysql-vol]# ls
_data
[root@Git_Server mysql-vol]# cd _data/
[root@Git_Server _data]# ls
909a06fb79c5.err binlog.000003 ca-key.pem #ib_16384_0.dblwr ib_logfile0 mysql.ibd server-cert.pem undo_002
auto.cnf binlog.000004 ca.pem #ib_16384_1.dblwr ib_logfile1 performance_schema server-key.pem wp
binlog.000001 binlog.000005 client-cert.pem ib_buffer_pool #innodb_temp private_key.pem sys
binlog.000002 binlog.index client-key.pem ibdata1 mysql public_key.pem undo_001
[root@Git_Server _data]# cd ..
[root@Git_Server mysql-vol]# ls
_data
[root@Git_Server mysql-vol]# cd ..
[root@Git_Server volumes]# ls
0705f71b5e59c50d34c0bf3eb444297254c47a968bfccfda272100a2e6c4dc3a a1fda3fb0d1eb5658b33a6258d8fdfb28cc6db97f298bc9a197712ee393a9a98 metadata.db
0a59cdcb996c5fcd0f206015d05c5d4365fd6bf5dfd2a53c189ee6008858275a ac77e553bb877613cbfa68d16ccfc11e60ab8f246b48991414c1216359c7c20f mysql-vol
[root@Git_Server volumes]# cd mysql-vol
[root@Git_Server mysql-vol]# ls
_data
[root@Git_Server mysql-vol]# rm -rf *