If you have previously tried to install MySQL in newer versions of Ubuntu, you probably encountered an error when running the mysql_secure_installation command or when trying to. Change the password using the SQL command ALTER USER. Next, let's try to understand why the error occurs, as well as how to fix Your password does not satisfy the current policy requirements MySQL.
It is known that MySQL includes plugins to check password complexity. By default the plugin does not work, but when mysql_secure_installation is executed, the program sends a request to the user to enable it, and if it does, it defaults to enabling it, unless the user has explicitly indicated that it is not necessary to enable it. The plugin checks the complexity of the password and does not allow a weak or insecure password to be set.
The plugin has three password requirement policies:
The mysql_secure_installation script makes a request to select the activation method, this happens as soon as the Password Validation Plugin is enabled. Initially, the status is set to MEDIUM:
If you select all default values and then try to specify a password that does not meet the requirements, for example, most often it will be the absence of a special character, you will get the error "Your password does not satisfy the current policy requirements".
The easiest and most effective way to fix this error is to specify a password that meets the policy requirements. For MEDIUM, this can be a password like ePhi4A! But it doesn't always work. If it is possible to lower the policy to LOW to change the password requirements were not as strict.
Perform connect to the MySQL database server:
$ mysql -u root -p
Or if non-password authorization is selected on the system:
$ sudo mysql
Then run a query like this:
$ SET GLOBAL validate_password.policy=LOW
Once you have changed the password to the correct one. Another option is to completely disable the password validation plugin.
Let's execute this SQL query:
$ UNINSTALL COMPONENT 'file://component_validate_password';
After disabling validation, set the required password.