mysql修改數據庫密碼


方法1:

運行MySQL 5.7 Command Line Client,輸入老的密碼;

use mysql;

update user set authentication_string=password('test1234') where user='root';

方法2:

運行MySQL 5.7 Command Line Client,輸入老的密碼;

set password=password('newpassword');

方法3:

alter user root@'localhost' identified by 'test1234';

假如已經修改mysql下的user表root賬號下的host為%時,需要用下面的語句

alter user root@'%' identified by 'test1234';

方法4:進入mysql的bin目錄:

    mysqladmin -uroot -poldpassword pasword "newpassword"

修改完密碼后,退出mysql,重啟mysql服務,密碼才能生效。


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM