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

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.


Release : 10.0

Component :


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


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:

Need to kill mysql process it was not started as a service 

# cd /var/run/mysqld

# kill `cat  /var/run/mysqld/`


# 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. 

Also after this command make sure mysql stopped 

# systemctl stop mysqld.service   

If not kill is 

# ps -ef | grep mysql

mysql    21710 21649  0 11:02 pts/0    00:00:03 mysqld --skip-grant-tables --user=mysql

Then # systemctl start mysqld.service