欧美bbbwbbbw肥妇,免费乱码人妻系列日韩,一级黄片

詳解Centos7 修改mysql指定用戶的密碼

 更新時(shí)間:2016年12月26日 17:21:59   作者:程序猿到攻城獅之旅  
本篇文章主要介紹了Centos7 修改mysql指定用戶的密碼,小編覺(jué)得挺不錯(cuò)的,現(xiàn)在分享給大家,也給大家做個(gè)參考。一起跟隨小編過(guò)來(lái)看看吧。

本文介紹了Centos7 修改mysql指定用戶的密碼,具體如下:

1.登陸mysql或者mariadb(兩種任選其一)

[root@localhost ~]# mysql -u root 
[root@localhost ~]# mysql -uroot -p

2.切換到存儲(chǔ)用戶名和密碼的數(shù)據(jù)庫(kù)

MariaDB [mysql]> use mysql;回車,會(huì)顯示以下內(nèi)容
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

3.修改密碼,適用password()函數(shù)進(jìn)行加密,實(shí)際上就是執(zhí)行sql語(yǔ)句來(lái)更新指定用戶的密碼

MariaDB [mysql]> update user set password=password('新密碼') where user='要更新密碼的用戶名';回車
  -> ;
Query OK, 0 rows affected (0.00 sec)
Rows matched: 5 Changed: 0 Warnings: 0

4.刷新用戶權(quán)限列表

MariaDB [mysql]> flush privileges;回車
Query OK, 0 rows affected (0.00 sec)

5.退出mysql登陸

MariaDB [mysql]> quit
Bye

6.重啟mysql或者mariadb服務(wù)

[root@localhost ~]# service mysqld restart(重啟mysql)
[root@localhost ~]# service mariadb restart(重啟mariadb)

以上就是本文的全部?jī)?nèi)容,希望對(duì)大家的學(xué)習(xí)有所幫助,也希望大家多多支持腳本之家。

相關(guān)文章

最新評(píng)論