新聞中心
centos下如何修改mysql的root密碼

成都創(chuàng)新互聯(lián)公司專業(yè)為企業(yè)提供高邑網(wǎng)站建設(shè)、高邑做網(wǎng)站、高邑網(wǎng)站設(shè)計(jì)、高邑網(wǎng)站制作等企業(yè)網(wǎng)站建設(shè)、網(wǎng)頁(yè)設(shè)計(jì)與制作、高邑企業(yè)網(wǎng)站模板建站服務(wù),10余年高邑做網(wǎng)站經(jīng)驗(yàn),不只是建網(wǎng)站,更提供有價(jià)值的思路和整體網(wǎng)絡(luò)服務(wù)。
1、用帳號(hào)登錄mysql
mysql –u root
或#mysql –uroot –p
2、改變用戶數(shù)據(jù)庫(kù)
命令:mysql>use mysql
mysql> use mysql
Reading table information for completion of table and column names
You can turn off this feature to get a quicker startup with -ADatabase changed
3、修改密碼
密碼要用password()函數(shù)進(jìn)行加密!?。。?/p>
命令:mysql> update user set password=password('root') where user='root';
mysql> update user set password=password('root') where user='root';
Query OK, 3 rows affected (0.00 sec)
Rows matched: 3 Changed: 3 Warnings: 0
4、刷新權(quán)限表
命令:mysql> flush privileges;
mysql> flush privileges;
Query OK, 0 rows affected (0.00 sec)
5、退出mysql并對(duì)mysql進(jìn)行重啟即可??!
service mysqld restart
網(wǎng)站題目:CentOS下如何修改MySQL的root密碼
轉(zhuǎn)載源于:http://fisionsoft.com.cn/article/dpdhcsh.html


咨詢
建站咨詢
