docker run --name mydb -p 3306:3306 -v /data/db/mariadb:/var/lib/mysql -e MYSQL_ROOT_PASSWORD=123456 -itd mariadb /bin/bash
root@6f494cc13cb4:/var/lib/mysql# ls
ls: cannot open directory '.': Permission denied
[root@shenggong mariadb]# vi /etc/selinux/config
[root@shenggong mariadb]# getenforce
Enforcing
[root@shenggong mariadb]# setenforce 0
[root@shenggong mariadb]# getenforce
Permissive
[root@shenggong mariadb]# docker exec -it mydb /bin/bash
root@6f494cc13cb4:/#
root@6f494cc13cb4:/#
root@6f494cc13cb4:/#
root@6f494cc13cb4:/#
root@6f494cc13cb4:/# cd /var/lib/mysql
root@6f494cc13cb4:/# mysql -uroot -p
Enter password:
ERROR 2002 (HY000): Can't connect to local server through socket '/run/mysqld/mysqld.sock' (2)