Access denied for userid@localhost when using mysql applications
search cancel

Access denied for userid@localhost when using mysql applications

book

Article ID: 136793

calendar_today

Updated On:

Products

CA Spectrum DX NetOps

Issue/Introduction

When trying to connect to MySQL or run a mysql application, the following error is presented:

$ ./mysql --defaults-file=../my-spectrum.cnf -uroot -proot

mysql: [Warning] Using a password on the command line interface can be insecure.

ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: YES)

Environment

CA Spectrum Release : 10.3.x, 10.4.x

Resolution

  1. At the bash shell (bash -login in Windows), navigate to:

    $SPECROOT/mysql/bin

  2. Using a known password, run:

    ./mysql --defaults-file=../my-spectrum.cnf -uroot -p<PASSWORD>

  3. At the MySQL command prompt, run the following commands:


    GRANT ALL on reporting.* to 'userid'@'localhost';


    flush privileges;