1. 程式人生 > >阿里雲伺服器mysql密碼重置、遠端連線設定

阿里雲伺服器mysql密碼重置、遠端連線設定

密碼重置
第一步在linux上輸入:mysqladmin -u root -p password
結果:Enter password: 輸入原密碼
New password: 輸入新密碼
Confirm new password:輸入新密碼
遠端連線
第一步輸入:mysql -uroot -p
結果:Enter password: 輸入密碼
第二步輸入:use mysql;(切換到mysql)
結果:Reading table information for completion of table and column names
You can turn off this feature to get a quicker startup with -A
Database changed
第三步輸入:update user set host = ‘%’ where user = ‘root’;
結果:Query OK, 1 row affected (0.00 sec)
Rows matched: 1 Changed: 1 Warnings: 0
第四步輸入:flush privileges;(重新整理許可權)
結果:Query OK, 0 rows affected (0.00 sec)

別忘了安全組,開放3306埠哦
直接新增安全組規則出入開放3306

基本這樣就結束了,用你工具連線就好,這裡我用的Navicat連線
轉載請帶連線哦!