ALTER USER
CautionChange passwords/expiry
ALTER USER 'user'@'host' IDENTIFIED BY '<new>';
Rotates passwords and expiry — coordinate app config updates in the same change window.
Examples
ALTER USER 'webapp'@'%' IDENTIFIED BY 'N3w-S3cret!';Rotate an app user's password
Syntax
ALTER USER 'u'@'h' IDENTIFIED BY 'pw' [PASSWORD EXPIRE];
Before you run it
Old credentials fail the instant you rotate.
Related commands
- CREATE USERCreate database users
- SHOW GRANTSShow grants
The same reference, with no signal at all
Every command and flow from this site, held on your device and searchable with no connection. Free to install, no ads.
Get it free on the App Store