您好,登錄后才能下訂單哦!
1).第一次設(shè)置root密碼 (默認(rèn)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設(shè)置密碼
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) |
免責(zé)聲明:本站發(fā)布的內(nèi)容(圖片、視頻和文字)以原創(chuàng)、轉(zhuǎn)載和分享為主,文章觀點不代表本網(wǎng)站立場,如果涉及侵權(quán)請聯(lián)系站長郵箱:is@yisu.com進(jìn)行舉報,并提供相關(guān)證據(jù),一經(jīng)查實,將立刻刪除涉嫌侵權(quán)內(nèi)容。