MySQL 8+ includes a password validation plugin (validate_password
) that enforces strong password rules by default. If you're working in a local development environment and want to disable this feature to allow simpler passwords (e.g., password
, 123456
), follow this safe step-by-step tutorial.
🔧 Step 1: Log into MySQL as Root
sudo mysql
🔧 Step 2: Uninstall the Password Validation Component
Run the following command in the MySQL prompt:
UNINSTALL COMPONENT 'file://component_validate_password';
If successful, you'll see:
Query OK, 0 rows affected
🔧 Step 3: Confirm That Validation Is Disabled
Check that the validation system is gone:
SHOW VARIABLES LIKE 'validate_password%';
If disabled, this will return an empty result set.
🔧 Step 4: Create a User with a Simple Password (Test)
Now that validation is disabled, try creating a user with a weak password:
CREATE USER 'devuser'@'localhost' IDENTIFIED BY '123';
GRANT ALL PRIVILEGES ON *.* TO 'devuser'@'localhost';
FLUSH PRIVILEGES;
This should now work without any errors.
↺ Optional: Re-enable Validation Later
If you want to bring back strong password policies:
INSTALL COMPONENT 'file://component_validate_password';
Then you'll need to restart MySQL:
sudo systemctl restart mysql