需要先关闭
    getenforce
    Enforcing
    setenforce 0

    1. #!/bin/bash
    2. cur_dir=`pwd`
    3. docker stop ycxi-mysql
    4. docker rm ycxi-mysql
    5. docker run --net ycxi-network --name ycxi-mysql -v ${cur_dir}/conf:/etc/mysql/conf.d -v ${cur_dir}/data:/var/lib/mysql -p 3309:3306 -e MYSQL_ROOT_PASSWORD=aA111111 -d mysql:8

    //-v $(pwd)/conf:/etc/mysql/conf.d
    sudo docker run —name ycx-mysql -v $(pwd)/data:/var/lib/mysql -e MYSQL_ROOT_PASSWORD=root -e MYSQL_DATABASE=rooadmin -p 3307:3306 -d mysql

    1. #!/bin/bash
    2. cur_dir=`pwd`
    3. docker stop ycxi-mysql
    4. docker rm ycxi-mysql
    5. docker run --name ycxi-mysql -v ${cur_dir}/data:/var/lib/mysql -p 3309:3306 -e MYSQL_ROOT_PASSWORD=rootadmin -d mysql:8

    my.cnf

    1. [mysqld]
    2. character-set-server=utf8mb4
    3. [client]
    4. default-character-set=utf8mb4
    5. [mysql]
    6. default-character-set=uft8mb4