Reset MySQL password for gateway user
search cancel

Reset MySQL password for gateway user

book

Article ID: 237245

calendar_today

Updated On: 10-04-2023

Products

CA API Gateway

Issue/Introduction

While trying to purge audits/logs from the staging API gateways, the connection to the MySQL database is failing with the default password. How do I reset the password for the "gateway" user?

Environment

API Gateway: 10.X

MySQL 8.X

Resolution

  1. Stop the gateway service
  2. Access MySQL as root
    • [root@ssg10-1 ~]# mysql (or mysql -u root -p)
    • mysql>
  3. Review the current password string for the gateway user (make a note of this string for comparison later)
    • mysql>select user, host, authentication_string from mysql.user where user = 'gateway';
  4. Reset the password for the gateway user (replace <password> with your own string in the following commands)
    • mysql>SET PASSWORD FOR 'gateway' = '<password>';
    • mysql>SET PASSWORD FOR 'gateway'@'localhost' = '<password>';
    • mysql>SET PASSWORD FOR 'gateway'@'localhost.localdomain' = '<password>';
    • mysql>SET PASSWORD FOR 'gateway'@'localhost6' = '<password>';
    • mysql>SET PASSWORD FOR 'gateway'@'localhost6.localdomain6' = '<password>';
  5. Check the password string again (and compare it with the one from the step 3 above)
    • mysql>select user, host, authentication_string from mysql.user where user = 'gateway';
    • mysql>exit
  6. Reconfigure the Gateway DB with the new password. From the ssgconfig menu:
    • Option 2 Display Layer7 API Gateway configuration menu
    • Option 3 Configure the Layer7 API Gateway
    • Option 1 Database connection
    • Accept all the default values - for the password field, enter the new password
    • S) Save and exit
  7. Start the gateway service

 

For a software Gateway, use these options for step 6 above:

  • Option 2 Configure the Layer7 API Gateway
  • Option 2 Database connection
  • Accept all the default values - for the password field, enter the new password
  • S) Save and exit

Additional Information

MySQL 8.0 Documentation: 13.7.1.10 SET PASSWORD Statement