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
Similar Posts:
- Docker Run MYSQL Container Error: [ERROR] –initialize specified but the data directory has files in it. Aborting.
- docker: Error response from daemon: Conflict. The container name “/xx” is already in use
- How to Solve docker run Error: oci runtime error
- Job for docker.service failed because the control process exited with error code. See “syste…
- Mac Run MongoDB error: exception in initAndListen: NonExistentPath: Data directory /data/db not found., t…
- Cannot find module ‘../lib/utils/unsupported.js’
- [Solved] Gitlab can clone via SSH, cannot clone via HTTP, and cannot pipeline. Prompt port 80: connection rejected
- Docker Container Error:Failed to get D-Bus connection: Operation not permitted
- [Solved] Bind for 0.0.0.0:80 failed: port is already allocated
- How to Solve Error Permission denied when running brew cleanup