Entrypoint]: mysqld failed while attempting to check config 2023-08-30 19:42:36 command was: mysqld --default-authentication-plugin...Entrypoint]: mysqld failed while attempting to check config 2023-08-30 19:42:39 command was: mysqld --default-authentication-plugin
mysql/conf.d -v /var/mapping/mysql_1/lib:/var/lib/mysql -e MYSQL_ROOT_PASSWORD=root -d mysql:8.0.20 --default-authentication-plugin...即映射文件,格式(宿主机数据卷:容器数据卷) -e:设置环境变量,如设置root的初始密码 MYSQL_ROOT_PASSWORD,可以在docker的镜像中心查看有哪些环境变量 -d:指定镜像 --default-authentication-plugin...--default-authentication-plugin=mysql_native_password指的是修改认证的加密方式,mysql8.0后的加密方式改了,导致navicat那些数据库管理工具连不上
FLUSH PRIVILEGES; 2.4、修改密码的加密方式 找到mysql的配置文件vim /etc/my.cnf,把密码的加密方式改成之前版本的,8.0版本更换了密码的加密方式,我们就先用旧的 #找到default-authentication-plugin...,将其注释取消 default-authentication-plugin=mysql_native_password #重启服务,使其生效 systemctl restart mysqld 2.5
/mysql/data/:/var/lib/mysql" #该选项中的命令会覆盖Dockfile中的CMD中的命令.lower_case_table_names参数是为了表名不区分大小写,default-authentication-plugin...是8.0中密码加密策略不同带来的链接问题,如果不用8.0可不加此选项 command: mysqld --lower_case_table_names=1 --default-authentication-plugin
上面连接不成功的问题也可以添加镜像参数--default-authentication-plugin=mysql_native_password来解决,完整命令如下 docker run -d -p 4306...name mysql001 mysql/mysql-server --character-set-server=utf8 --collation-server=utf8_general_ci --default-authentication-plugin
services: mysql: image: mysql container_name: local_mysql entrypoint: ['/entrypoint.sh', '--default-authentication-plugin
network_mode: "host" mysql: image: mysql:latest container_name: mysql command: --default-authentication-plugin.../database:/var/lib/mysql command: --default-authentication-plugin=mysql_native_password
container_name: db restart: always networks: - memos_network command: - --default-authentication-plugin
zabbix-net \ -d mysql \ --character-set-server=utf8 --collation-server=utf8_bin \ --default-authentication-plugin...zbx_net command: - mysqld - --character-set-server=utf8 - --collation-server=utf8_bin - --default-authentication-plugin
/mysqldata:/var/lib/mysql command: --default-authentication-plugin=mysql_native_password environment.../mysqldata:/var/lib/mysql command: --default-authentication-plugin=mysql_native_password ports.../mysqldata:/var/lib/mysql command: --default-authentication-plugin=mysql_native_password ports
docker-entrypoint-initdb.d/ command: # 将mysql8.0默认密码策略 修改为 原先 策略 (mysql8.0对其默认策略做了更改 会导致密码无法匹配) --default-authentication-plugin
zabbix-net \ -d mysql:8.0 \ --character-set-server=utf8 --collation-server=utf8_bin \ --default-authentication-plugin...docker.io/library/mysql:8.0 \ --character-set-server=utf8 --collation-server=utf8_bin \ --default-authentication-plugin
usr/local/mysqldata/data801913380 --plugin-dir=/usr/local/mysqlsoft/8.0.19/lib/plugin --user=mysql --default-authentication-plugin...datadir=/usr/local/mysqldata/data810 --plugin-dir=/usr/local/mysqlsoft/8.1.0/lib/plugin --user=mysql --default-authentication-plugin...usr/local/mysqldata/data801913380 --plugin-dir=/usr/local/mysqlsoft/8.0.19/lib/plugin --user=mysql --default-authentication-plugin...datadir=/usr/local/mysqldata/data810 --plugin-dir=/usr/local/mysqlsoft/8.1.0/lib/plugin --user=mysql --default-authentication-plugin
password # (this is just an example, not intended to be a production configuration) command: --default-authentication-plugin
apollo-db: image: mysql:5.7 container_name: apollo-db restart: always command: --default-authentication-plugin
解决方式是在启动容器时指定参数: docker run -p 3306:3306 --name mysql8 -e MYSQL_ROOT_PASSWORD=111111 -d mysql:8.0.11 --default-authentication-plugin...=mysql_native_password 重点是添加了: --default-authentication-plugin=mysql_native_password 之后就可以正常登陆了,使用docker
version: "3" services: mysql: container_name: dlnmpr-mysql image: mysql:8.0 command: --default-authentication-plugin
数据库初始化 /usr/local/mysql/bin/mysqld --user=mysql --basedir=/usr/local/mysql --datadir=/data/mysql --default-authentication-plugin
以下是本人使用的my.cnf: [mysqld] ... default-authentication-plugin=mysql_native_password lower_case_table_names
领取专属 10元无门槛券
手把手带您无忧上云