MySQL 8.0: set very temporary password during restore on new system Db account

Version 1.58


When creating all new databases from a User restore with MySQL 8.0 installed, DA needs to create a system account to put on this DB. DA does not know the plaintext password, but does know the crypted password from before. Previously, DA would create the system acount with: CREATE USER 'systemacocunt'@'localhost' and the raw password and grants are set on it immediately after. With MySQL 8.0, it requires a password to be set, else you may hit this error message: "Your password does not satisfy the current policy requirements" The solution we've used is to create a random password, and append IDENTIFIED BY 'randomescapedpassword', to satisfy this need. The old crypted value and grants are immediately followed, so the temp value is very short lived and does not need to be recorded. T16772

Interested to try DirectAdmin? Get a 30-day Free Trial!