第七色在线视频,2021少妇久久久久久久久久,亚洲欧洲精品成人久久av18,亚洲国产精品特色大片观看完整版,孙宇晨将参加特朗普的晚宴

為了賬號安全,請及時綁定郵箱和手機立即綁定

修改mysql賬戶密碼

標(biāo)簽:
MySQL

Summary: in this tutorial you will learn how to change or reset password for MySQL account in various ways by using the UPDATESET PASSWORD and GRANT statements.

Before changing the password, there are some points that you should consider:

  • Which user do you want to change the password?

  • What host, which the user connects to, you want to change the password?

  • Have you been aware of the related applications that are currently using the MySQL account whose password is being changed?If you change the password without proper planning, those applications will lose the connection to the database and stop functioning properly.

MySQL provides several statements that you can use to change or reset password of a MySQL account including UPDATE statement, SET PASSWORD statement and GRANT USAGE statement.

MySQL changing password using UPDATE statement

The first way to change the password is to use the UPDATE statement to update the User and Host column of the user table in the mysql database. After executing the UPDATE statement, you need to execute the FLUSH PRIVILEGES statement to reload privileges from the grant table in the mysql database.

Suppose you want to change the password for OutOfMemory user that connect from the  OutOfMemory.CN host to Secret1970, you need to execute the following statements:

USE mysql; UPDATE user  SET password = PASSWORD('Secret1970') WHERE user = 'OutOfMemory' AND        host = 'OutOfMemory.CN'; FLUSH PRIVILEGES;

It is important to note that we’ve used the PASSWORD() function to encrypt the plain text password. The following example demonstrates how the PASSWORD() function encrypts a plain text password.

SELECT PASSWORD('Secret1970') AS encrypt_password

 

*16A54B5EE15C823362FAE7F64409A8F8C8501DD6

 

MySQL changing password using SET PASSWORD statement

The second way to change the password is by using the SET PASSWORD statement. You use the MySQL account in  user@host format to update the password. If you need to change password for other accounts, you need to have at least UPDATE privilege. You don’t need to execute the FLUSH PRVILILEGES statement to reload privileges from grant table.

The following statement change password of OutOfMemory account by using the SET PASSWORD statement.

SET PASSWORD FOR 'mysqltutorail'@'OutOfMemory.CN' = PASSWORD('Secret1970')

 

MySQL changing password using GRANT USAGE statement

The third way to change the password is by using the GRANT USAGE statement with the IDENTIFIED BY clause. In this way, you specify the password in plain text instead of the encrypted from.

The following statement changes the password of OutOfMemory account by using the GRANT USAGE statement:

GRANT USAGE ON *.* TO OutOfMemory@OutOfMemory.CN IDENTIFIED BY Secret1970

In case you want to reset the MySQL root account’s password, you need to force the MySQL database server to stop and restart without using grant table validation.

In this tutorial, we introduced you to some handy MySQL statements that allows you to change MySQL accounts password.

Related Tutorials

原文链接:http://outofmemory.cn/mysql/administration/mysql-changing-password

點擊查看更多內(nèi)容
TA 點贊

若覺得本文不錯,就分享一下吧!

評論

作者其他優(yōu)質(zhì)文章

正在加載中
  • 推薦
  • 評論
  • 收藏
  • 共同學(xué)習(xí),寫下你的評論
感謝您的支持,我會繼續(xù)努力的~
掃碼打賞,你說多少就多少
贊賞金額會直接到老師賬戶
支付方式
打開微信掃一掃,即可進(jìn)行掃碼打賞哦
今天注冊有機會得

100積分直接送

付費專欄免費學(xué)

大額優(yōu)惠券免費領(lǐng)

立即參與 放棄機會
微信客服

購課補貼
聯(lián)系客服咨詢優(yōu)惠詳情

幫助反饋 APP下載

慕課網(wǎng)APP
您的移動學(xué)習(xí)伙伴

公眾號

掃描二維碼
關(guān)注慕課網(wǎng)微信公眾號

舉報

0/150
提交
取消