Update Permissions for otk_user to [email protected]%

book

Article ID: 143172

calendar_today

Updated On:

Products

CA API Gateway API SECURITY CA API Gateway Precision API Monitoring Module for API Gateway (Layer 7) CA API Gateway Enterprise Service Manager (Layer 7) STARTER PACK-7 CA Microgateway

Issue/Introduction

I need to update permissions for otk_user to permit connections from hosts other than localhost. The recommendation from support to run the following command:

 

My recommendation is to set the JDBC query url to a more suitable configuration for multi db environment similar to the following:

 

jdbc:mysql://HostName1:3306,HostName2:3306/otk_db?failOverReadOnly=false&autoReconnect=true&connectTimeout=1

 

 

grant all on otk_db.* to [email protected]'%';

UPDATE mysql.user SET password = PASSWORD('otk_user_password') WHERE user = "otk_user"; flush privileges;

 

However, that command results in the following error:

 

ERROR 1133 (42000): Can't find any matching row in the user table

 

 

 

Environment

Release : 9.3

Component : API GTW ENTERPRISE MANAGER

Resolution

If, 

# mysql 

mysql> select user, host from mysql.user;

Doesnt show a [email protected]% 

Just a [email protected] 

The problem is the original user is defined as [email protected] but you are trying to grant all on [email protected]%

You need to run a create user before doing the grant and update.

# mysql

mysql> create user 'otk_user'@'%'

mysql> grant
all on otk_db.* to [email protected]'%';

mysql> UPDATE
mysql.user SET password = PASSWORD('otk_user_password') WHERE user =
"otk_user"; flush privileges;

Or  instead  run the following to create and grant 
mysql> grant
all on otk_db.* to [email protected]'%' identified by ''; flush privileges;