154-docker 安装mysql 区分大小写

时间:2022-12-25 08:56:54

拉镜像:

docker pull mysql:latest

启动容器:

docker run -p 3306:3306 --name mysql-case \
-v /mydata/mysql/log:/var/log/mysql \
-v /mydata/mysql/data:/var/lib/mysql \
-v /mydata/mysql/conf:/etc/mysql/conf.d \
-e MYSQL_ROOT_PASSWORD=123456 \
-d mysql:latest --lower_case_table_names=0

进入容器:

docker exec -it mysql-case /bin/bash

登录mysql:

mysql -u root -p

授权可远程登录:

grant all privileges on *.* to root@'%' with grant option;