简体   繁体   中英

Change MySQL password without displaying it

There are many solutions and documentation on the web that have an answer on how to change a MySQL user password. All of them though, display the password to be changed. Is there a way that the new password be hidden or replaced by asterisks for increased security?

You can use the mysqladmin command:

mysqladmin -u user -p -h localhost password

where:

  • user : is the username.
  • localhost : you can change this to your host, or leave it as is for localhost.
  • password : is the mysqladmin command that instructs the change of password.

By executing the above command, you will be prompted to enter you current password and then type your new password, both without the characters being displayed on the screen.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM