Skip to main content

MySQL: how to change user password

It so happens that you need to quickly change the user's password, and there is no control panel on the server. In this case, you can use the console command, which must be executed as root on the mysql server.

  mysql> SET PASSWORD FOR 'username' @ 'hostname' = PASSWORD (' newPassWord '); 

username is the name of the database user.
hostname - domain, as a rule, localhost or IP
newPassWord - replace with a new password.

The password can use letters, numbers and some special characters: @, #, _. Also, for security reasons, the password does not have to match the username.

How do you rate the article?
Звёзд: 1Звёзд: 2Звёзд: 3Звёзд: 4Звёзд: 5 (No ratings yet)

Add a comment

Your email will not be published.