Docker安装Mysql8.0

Window10下安装Mysql8.0

1、下载并安装docker
安装docker过程中可能需要更行wsl,根据提示执行wsl --update命令。
2、拉取mysql镜像

docker pull mysql:8.0.20

3、修改mysql.cnf

[mysqld]
user=mysql
socket=/var/run/mysqld/mysqld.sock
default_authentication_plugin=mysql_native_password
secure_file_priv=/var/lib/mysql
expire_logs_days=7
sql_mode=STRICT_TRANS_TABLES,NO_ZERO_IN_DATE,NO_ZERO_DATE,ERROR_FOR_DIVISION_BY_ZERO,NO_ENGINE_SUBSTITUTION
max_connections=1000
init-connect='SET collation_connection = utf8_unicode_ci'
init-connect='SET NAMES utf8'
default-time_zone = '+8:00'
character-set-server

你可能感兴趣的:(环境搭建,mysql)