Logo
  • Ubuntu
  • CentOS
  • Debian
  • Fedora
  • RedHat

How to Fix “MySQL ERROR 1819 (HY000):” in Linux - DesignLinux

Dec 03 2020
designlinux 0 Comments

When creating a MySQL user with a relatively weak password, you might encounter the error ‘MySQL ERROR 1819 (HY000): Your password does not satisfy the current policy requirements’. Technically, this is not an error, but a notification that you are using a password that does not meet the recommended password policy requirements.

In other words, you are using a weak password that can easily be guessed or brute-forced. The built-in security mechanism discourages users from creating weak passwords which can render your database prone to breaches.

Related Article: Useful Tips to Troubleshoot Common Errors in MySQL

For example, I ran into the error when creating a user as shown

mysql> create user ‘tecmint’@’localhost’ IDENTIFIED BY ‘mypassword’;
MySQL ERROR 1819 (HY000)
MySQL ERROR 1819 (HY000)

It’s a no brainer that the password is extremely weak and can present a security risk.

How to Solve MySQL ERROR 1819 (HY000) in Linux

The MySQL database ships with a validate_password plugin which when enabled, enforces a password validation policy. There are 3 levels of password validation policy that are enforced by the plugin.

  • LOW: Allows users to set a password of 8 or fewer characters.
  • MEDIUM: Allows users to set a password of 8 or fewer characters with mixed cases and special characters.
  • STRONG: Allows users to set a password that has all the attributes of a medium-level password with the inclusion of a dictionary file.

By default, the password policy is set to MEDIUM. You can confirm the password policy level, by executing the command:

$ SHOW VARIABLES LIKE 'validate_password%';
Check Mysql Password Policy
Check Mysql Password Policy

If you run the command and get the output empty set, then the plugin is not enabled yet.

To enable the validate_password plugin, run the commands below.

mysql> select plugin_name, plugin_status from information_schema.plugins where plugin_name like 'validate%';
mysql> install plugin validate_password soname 'validate_password.so';

To confirm that the plugin is activated, run the command.

mysql> select plugin_name, plugin_status from information_schema.plugins where plugin_name like 'validate%';

You should get the output shown below:

Enable Mysql Password Policy
Enable Mysql Password Policy

To resolve the issue, you need to set the password validation policy to the lowest level. I know this sounds counterintuitive as it creates an avenue for setting weak passwords which can ultimately cause your database to be compromised by hackers.

However, if you still insist on having your way, here’s what you can do.

How to Change MySQL Password Validation Policy

To resolve the MySQL ERROR 1819 (HY000) error, set a lower password validation policy as shown.

mysql> SET GLOBAL validate_password_policy=LOW;
OR
mysql> SET GLOBAL validate_password_policy=0;

You can thereafter confirm the password validation policy level.

$ SHOW VARIABLES LIKE 'validate_password%';
Change Mysql Password Policy
Change Mysql Password Policy

Now you can proceed and assign a relatively weak password as per your wish.

mysql> create user ‘tecmint’@’localhost’ IDENTIFIED BY ‘mypassword’;

To revert to the ‘MEDIUM’ password policy level, simply invoke the command:

mysql> SET GLOBAL validate_password_policy=MEDIUM;
Conclusion

Personally, I wouldn’t recommend setting a lower level password policy for obvious reasons. Whether it’s a normal user or a database user, it’s recommended to always set a strong MySQL password with more than 8 characters with a mix of uppercase, lowercase, numeric and special characters.

This guide is for the sake of those who want to know how to navigate such an error, otherwise, setting a strong password is always recommended.

Related

Tags: CentOS FAQ's, Debian FAQ's, MySQL Tips, Ubuntu FAQ's

The Best RedHat-based Linux Distributions

Prev Post

How to Install PHP 8 on Ubuntu 20.04

Next Post
Archives
  • January 2023
  • December 2022
  • November 2022
  • October 2022
  • September 2022
  • July 2022
  • June 2022
  • April 2022
  • March 2022
  • February 2022
  • January 2022
  • December 2021
  • November 2021
  • October 2021
  • September 2021
  • August 2021
  • July 2021
  • June 2021
  • May 2021
  • April 2021
  • March 2021
  • February 2021
  • January 2021
  • December 2020
  • November 2020
  • October 2020
  • September 2020
  • August 2020
  • July 2020
  • June 2020
  • May 2020
Categories
  • AlmaLinux
  • Android
  • Ansible
  • Apache
  • Arch Linux
  • AWS
  • Backups
  • Bash Shell
  • Bodhi Linux
  • CentOS
  • CentOS Stream
  • Chef
  • Cloud Software
  • CMS
  • Commandline Tools
  • Control Panels
  • CouchDB
  • Data Recovery Tools
  • Databases
  • Debian
  • Deepin Linux
  • Desktops
  • Development Tools
  • Docker
  • Download Managers
  • Drupal
  • Editors
  • Elementary OS
  • Encryption Tools
  • Fedora
  • Firewalls
  • FreeBSD
  • FTP
  • GIMP
  • Git
  • Hadoop
  • HAProxy
  • Java
  • Jenkins
  • Joomla
  • Kali Linux
  • KDE
  • Kubernetes
  • KVM
  • Laravel
  • Let's Encrypt
  • LFCA
  • Linux Certifications
  • Linux Commands
  • Linux Desktop
  • Linux Distros
  • Linux IDE
  • Linux Mint
  • Linux Talks
  • Lubuntu
  • LXC
  • Mail Server
  • Manjaro
  • MariaDB
  • MongoDB
  • Monitoring Tools
  • MySQL
  • Network
  • Networking Commands
  • NFS
  • Nginx
  • Nodejs
  • NTP
  • Open Source
  • OpenSUSE
  • Oracle Linux
  • Package Managers
  • Pentoo
  • PHP
  • Podman
  • Postfix Mail Server
  • PostgreSQL
  • Python
  • Questions
  • RedHat
  • Redis Server
  • Rocky Linux
  • Security
  • Shell Scripting
  • SQLite
  • SSH
  • Storage
  • Suse
  • Terminals
  • Text Editors
  • Top Tools
  • Torrent Clients
  • Tutorial
  • Ubuntu
  • Udemy Courses
  • Uncategorized
  • VirtualBox
  • Virtualization
  • VMware
  • VPN
  • VSCode Editor
  • Web Browsers
  • Web Design
  • Web Hosting
  • Web Servers
  • Webmin
  • Windows
  • Windows Subsystem
  • WordPress
  • Zabbix
  • Zentyal
  • Zorin OS
Visits
  • 0
  • 82
  • 605,832

DesignLinux.com © All rights reserved

Go to mobile version