进入容器:docker exec -it mysql bash
登录mysql:mysql -u root -p ALTER USER 'root'@'localhost' IDENTIFIED BY 'root';
添加远程登录用户:CREATE USER 'root'@'%' IDENTIFIED WITH mysql_native_password BY 'root';GRANT ALL PRIVILEGES ON *.* TO 'root'@'%';
进入容器:docker exec -it mysql bash
登录mysql:mysql -u root -p ALTER USER 'root'@'localhost' IDENTIFIED BY 'root';
添加远程登录用户:CREATE USER 'root'@'%' IDENTIFIED WITH mysql_native_password BY 'root';GRANT ALL PRIVILEGES ON *.* TO 'root'@'%';