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中文網其他相關文章!