Unable to start MySQL on CentOS
Solution 1:
I had a similar issue with Kubernetes and MySQL 5.7 as well.
Adding the suggestion from yosifki to my container's definition got things working.
A new ext4 disk partition is not usually empty; there is a lost+found directory, which mysql is known to choke on. You could try adding --ignore-db-dir=lost+found to the CMD to know for sure (from mysql docs)
Here's an extract of my working YAML definition:
name: mysql-master
image: mysql:5.7
args:
- "--ignore-db-dir=lost+found"
Here's an example snippet in docker-compose to clarify:
version: '3'
services:
mysql-master:
image: mysql:5.7
command: [--ignore-db-dir=lost+found]
environment:
- MYSQL_ROOT_PASSWORD=root