Tag Archives: [ERROR] InnoDB: redo log file ‘./ib_logfile0’ exists

Docker Run Mysql Container Error: [ERROR] InnoDB: redo log file ‘./ib_logfile0’ exists

background

Start the MySQL container by running the local MAC docker

docker run -d -p 3306:3306 --name mysql1 -v /Users/polo/data/conf:/etc/mysql/conf.d -v /Users/polo/data/mysql:/var/lib/mysql  -e MYSQL_ROOT_PASSWORD=123456 -d mysql:5.7

phenomenon

Check the container log and find that an error is reported, and the local Navicat cannot be connected

The key point is the first sentence. If a certain file already exists, the environment is usually overwritten

Root cause

MySQL was previously installed through brew. Although it was uninstalled, the local files were not deleted

Solution

Reference links for problem solving

brew uninstall mysql
rm -rf /usr/local/var/mysql

Uninstall MySQL first, and then delete the local files

Start the log of MySQL container normally

No error log