MySQL修改密碼的方式
為京口等地區(qū)用戶提供了全套網(wǎng)頁設(shè)計制作服務(wù),及京口網(wǎng)站建設(shè)行業(yè)解決方案。主營業(yè)務(wù)為成都做網(wǎng)站、網(wǎng)站制作、京口網(wǎng)站設(shè)計,以傳統(tǒng)方式定制建設(shè)網(wǎng)站,并提供域名空間備案等一條龍服務(wù),秉承以專業(yè)、用心的態(tài)度為用戶提供真誠的服務(wù)。我們深信只要達到每一位用戶的要求,就會得到認可,從而選擇與我們長期合作。這樣,我們也可以走得更遠!
如果忘記密碼--skip-grant-tables
1、alter user
alter user test@'localhost' identified by 'xxxx!';
2、grant
show grants for test@'localhost'; GRANT USAGE ON *.* TO 'test'@'localhost' IDENTIFIED BY PASSWORD '*xxxxxxxxxxxxx';
GRANT USAGE ON *.* TO 'test'@'localhost' IDENTIFIED BY 'xxxxxxxxxxxxx';
3、set password
set password for test@'localhost'=password('xxx')
4、update mysql.user
mysql> UPDATE mysql.user SET Password = PASSWORD('newpass') WHERE user = 'test' and host='localhost'; mysql> FLUSH PRIVILEGES;
5、mysqladmin
mysqladmin -u test password "newpass" #第一次設(shè)置 mysqladmin -u test password oldpass "newpass" #如果root已經(jīng)設(shè)置過密碼,采用如下方法