變更MySQL 8的root使用者密碼 === **一、找一台Ubuntu的電腦啟動一個docker的mysql服務** ```shell= docker run --name some-mysql1 -e MYSQL_ROOT_PASSWORD=123456 -d mysql:8.0.29` ```  **二、進入這台`mysql`環境** ```shell= docker exec -it 67 bash ```  **二、進入`mysql`環境介面** ```shell= mysql -uroot -p ```  **四、更改mysql的root密碼** ```mysql= ALTER USER 'root'@'localhost' IDENTIFIED WITH caching_sha2_password BY 'NewPassword'; exit; ```  **五、重新登入成功** ```shell= mysql -uroot -pNewPassword ``` 
×
Sign in
Email
Password
Forgot password
or
By clicking below, you agree to our
terms of service
.
Sign in via Facebook
Sign in via Twitter
Sign in via GitHub
Sign in via Dropbox
Sign in with Wallet
Wallet (
)
Connect another wallet
New to HackMD?
Sign up