Recover Percona MySQL Root Password (Step-by-Step Guide)

Losing access to your Percona MySQL root account can be stressful, especially in production environments where uptime and data access are critical. Fortunately, recovering the root password is a safe and straightforward process, as long as you still have root or sudo-level access to the server itself. This guide will walk you through the complete steps to reset your Percona root password securely — without risking data loss or extended downtime. Whether you’ve forgotten the credentials, inherited a system with unknown access, or are troubleshooting a user authentication issue, this method will help you regain full control over your database.

Recover Percona MySQL Root Password

🛠 Step 1: Stop the MySQL Service

Stop the MySQL service to start it manually without password authentication.

sudo systemctl stop mysql

🔧 Step 2: Start MySQL in Safe Mode

Start MySQL without privilege checking (no password required).

sudo mysqld_safe --skip-grant-tables --skip-networking &

--skip-grant-tables: disables password checking

--skip-networking: prevents external connections during reset

Wait a few seconds until it’s running.

🔑 Step 3: Log into MySQL Without Password

mysql -u root

🧩 Step 4: Update the Root Password

Once inside the MySQL shell, run:

FLUSH PRIVILEGES;
ALTER USER 'root'@'localhost' IDENTIFIED BY 'NewSecurePassword123!';

Or (for MySQL versions < 5.7 or if ALTER fails):

SET PASSWORD FOR 'root'@'localhost' = PASSWORD('NewSecurePassword123!');

🔁 Step 5: Exit and Restart MySQL Normally

exit
sudo systemctl stop mysql
sudo systemctl start mysql

✅ Step 6: Test the New Password

mysql -u root -p

Enter the new password when prompted.