MySQL Forums
Forum List  »  General

Access denied on login from shell script.
Posted by: Sankar Raja
Date: December 11, 2020 11:13AM

When I login to localhost I have no issues to log in, but when I use a shell script (ksh) to login and get information, I get access denied.

I am executing the shell script in the local server where mysql daemons are running.

error:

Connecting to the mysql ..
ERROR 1045 (28000): Access denied for user 'cmpl_user'@'localhost' (using password: YES)

code:

/home/cmpl/bin/mysql --host ="${HOST_NAME}" --port="${PORT_NUMBER}" --user="${USERNAME}" --database="${DB_NAME}" -c "select host, user, password_expired, password_last_changed from mysql.user where user='${USERNAME}';" |tee -a ${log_file}

I used FQDN but still get access denied. I came to know from others when you have special characters in the password then you get the error if the password isn't with in quotes.

Where am I missing things?

Options: ReplyQuote


Subject
Written By
Posted
Access denied on login from shell script.
December 11, 2020 11:13AM


Sorry, only registered users may post in this forum.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.