docker版本
docker pull mysql/mysql-server
docker run --name='sql_container' -d -p 3306:3306 mysql/mysql-server
docker 日志 sql_container
docker exec -it sql_container bash cd /var/lib/mysql mysql -u root -p ALTER USER 'root'@'localhost' IDENTIFIED BY 'password';
CREATE USER 'user'@'%' IDENTIFIED BY 'passwod'; GRANT ALL PRIVILEGES ON *.* TO 'user'@'%' WITH GRANT OPTION; FLUSH PRIVILEGES;
host = localhost port = 3306 user_name = user user_password = password
以上是在 Docker 中运行 MySQL 服务器的详细内容。更多信息请关注PHP中文网其他相关文章!