Rumah >pangkalan data >tutorial mysql >Menjalankan Pelayan MySQL di Docker
versi buruh pelabuhan
docker pull mysql/mysql-server
larian docker --name='sql_container' -d -p 3306:3306 mysql/mysql-server
docker log 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
Atas ialah kandungan terperinci Menjalankan Pelayan MySQL di Docker. Untuk maklumat lanjut, sila ikut artikel berkaitan lain di laman web China PHP!