# docker 中下载 mysql docker pull mysql #启动 docker run --name mysql -p 3306:3306 -e MYSQL_ROOT_PASSWORD=Lzslov123! -d mysql #进入容器 docker exec -it mysql bash #登录mysql mysql -u root -p #修改默认的root密码 ALTER USER 'root'@'localhost' IDENTIFIED BY '123456'; #添加远程登录用户 CREATE USER 'doubaoyuanma'@'%' IDENTIFIED WITH mysql_native_password BY '123456'; GRANT ALL PRIVILEGES ON *.* TO 'doubaoyuanma'@'%';
原文链接:https://doubaoyuanma.com/313.html,转载请注明出处。
评论0