您好,登錄后才能下訂單哦!
1).第一次設置root密碼 (默認root密碼為空)
1 | [root@mysql1 ~]# mysqladmin -uroot password '123456' |
2).修改root密碼
1 | [root@mysql1 ~]# mysqladmin -uroot -p123456 password '123456789' |
1 | [root@mysql1 ~]# mysqladmin -uroot -p123456789 password 'hua19900822**' |
3).set password設置密碼
1 2 3 4 5 | mysql> set password=password('123456'); #修改密碼 Query OK, 0 rows affected (0.00 sec)
mysql> flush privileges; #同步到磁盤上 Query OK, 0 rows affected (0.00 sec) |
4).update語句修改密碼
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 | mysql> use mysql; Database changed mysql> select user,host,password from user; +------+-----------+-------------------------------------------+ | user | host | password | +------+-----------+-------------------------------------------+ | root | localhost | *6BB4837EB74329105EE4568DDA7DC67ED2CA2AD9 | | root | mysql1 | | | root | 127.0.0.1 | | | root | ::1 | | | | localhost | | | | mysql1 | | +------+-----------+-------------------------------------------+ 6 rows in set (0.00 sec)
mysql> update user set password=PASSWORD('789789') where user='root' and host='localhost'; Query OK, 1 row affected (0.00 sec) Rows matched: 1 Changed: 1 Warnings: 0
mysql> flush privileges; Query OK, 0 rows affected (0.00 sec) |
免責聲明:本站發布的內容(圖片、視頻和文字)以原創、轉載和分享為主,文章觀點不代表本網站立場,如果涉及侵權請聯系站長郵箱:is@yisu.com進行舉報,并提供相關證據,一經查實,將立刻刪除涉嫌侵權內容。