ALERT: Some images may not load properly within the Knowledge Base Article. If you see a broken image, please right-click and select 'Open image in a new tab'. We apologize for this inconvenience.

Broadcom - Gateway 10.x Appliance : How to reset Database Root password in MySQL 8.x


Article ID: 237226


Updated On:


CA API Gateway


Unable to access MySQL console as ROOT due to lost and/or unknown password. 

Attempted to reset the password by following the below KB article, however, it appears not working with MySQL 8.x version.


The procedure to reset DB Root password is slightly different in MySQL 8.x from what used to be in MySQL 5.x.


Release : 10.0

Component :


Start MySQL service with the --skip-grant-tables option and alter the ROOT password with the following steps:

  • First, make sure that the MySQL service is stopped.

# systemctl stop mysqld.service   

  • Then start MySQL service with the following options appended into the command line:

# mysqld --skip-grant-tables --user=mysql &

  • At this stage, you should be able to connect MySQL console (without entering credentials) by simply running:

# mysql

  • When MySQL service is started with --skip-grant-tables option, account-management is disabled and we must reload the grants in order to alter the password. In order to do so, reload users privileges:


  • At this stage, we can use the following query to update the ROOT password. Replace “new_password” with the actual password you desire to use

# ALTER USER 'root'@'localhost' IDENTIFIED BY 'new_password';

  • Stop MySQL service and start it back as in normal circumstances:

# systemctl stop mysqld.service   

# systemctl start mysqld.service   


Additional Information

Please, do not forget to update /root/.my.cnf file with the new password if you store it under the OS user profile.