Docker failed to start the container after installing mysql. Check the MySQL container log and find:
[ERROR] [FATAL] InnoDB: Table flags are 0 in the data dictionary but the flags in file ./ibdata1 are 0x4800!
Query all containers
docker ps -a
Delete container
docker rm CONTAINER ID; #CONTAINER ID is the actual container number
If so, be sure to delete the external mount directory.
Restart mysql. I installed version 5.7 of MySQL
docker run -p 3306:3306 --name mysql \
-v /mydata/mysql/log:/var/log/mysql \
-v /mydata/mysql/data:/var/lib/mysql \
-v /mydata/mysql/conf:/etc/mysql \
-e MYSQL_ROOT_PASSWORD=root \
-d mysql:5.7
Enter the container external mount profile
vim /mydata/mysql/conf/my.conf
Insert the following. Copy the following contents. After entering the file through the previous operation, press keyboard I to enter the insertion state, shift + insert to paste the contents, ESC to exit the insertion mode,: WQ save and exit
[client]
default-character-set=utf8
[mysql]
default-character-set=utf8
[mysqld]
init_connect='SET collation_connection = utf8_unicode_ci'
init_connect='SET NAMES utf8'
character-set-server=utf8
collation-server=utf8_unicode_ci
skip-character-set-client-handshake
skip-name-resolve
Restart MySQL
docker restart mysql
Read More:
- MySQL Error: [ERROR] [FATAL] InnoDB: Table flags are 0 in the data dictionary but the flags in file
- [Solved] Centons7 docker:mysql:5.7 [ERROR] InnoDB: Unable to lock ./ibdata1 error: 11
- Linux Error: [ERROR] –initialize specified but the data directory has files in it. Aborting.
- [Solved] there are special symbols in the initial password for installing MySQL in Hadoop, and an error is reported
- MySQL character set error resolution: err=Error 3988: Conversion from collation utf8mb4_unicode_ci into utf8_general_ci impo
- How to release Oracle PLSQL data lock table
- C# System.Data.SQLite.SQLiteException:“SQL logic error or missing database no such table: XX”
- [Solved] Canal Error: Could not find first log file name in binary log index file
- Error 1406 (22001) in MySQL: data too long for column (Fixed)
- [ERROR] InnoDB: The error means mysqld does not have the access rights to the directory.
- RECEIVED ERROR PACKET: ERRNO = 1236, SQLSTATE = HY000 ERRMSG = COULD NOT FIND FIRST LOG FILE NAME IN BINARY LOG INDEX FILE
- MySQL Build table error: You have an error in your SQL syntax; check the manual that corresponds to your MySQL ser
- [Solved]Error 1054 (42s22): unknown column ‘password’ in ‘field list’ how to modify the password
- [Solved] Error response from daemon: Conflict. The container name “/mysql is already in use by container
- How to Fix MySQL error 1005: can’t create table (errno: 150)
- scm_prepare_database.sh CDH initial data script execute error
- MySQL 8.0 error 1114 (HY000): the table’sbtest1’is full (Fixed)
- [Solved] mysqli::__construct(): Server sent charset (255) unknown to the client. Please, report to the developers in
- How to Solve Mysql8 load data error
- Problems in connecting mysql8.0 in IDEA [How to Solve]