需要先关闭
getenforce
Enforcing
setenforce 0
#!/bin/bash
cur_dir=`pwd`
docker stop ycxi-mysql
docker rm ycxi-mysql
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
#!/bin/bash
cur_dir=`pwd`
docker stop ycxi-mysql
docker rm ycxi-mysql
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
[mysqld]
character-set-server=utf8mb4
[client]
default-character-set=utf8mb4
[mysql]
default-character-set=uft8mb4