Are you attempting to log into the mysql instance or are you trying to determine if the mysql instance is running or not?
If the former, your access is being denied because you're not supplying the password to the server and so you must invoke the mysql command using the "--password" command line argument and actually supply the relevant password.
If the latter, try using the mysqladmin command instead of the mysql command. mysqladmin is a utility for performing administrative operations:
[root@sandbox-hdp ~]# mysqladmin -u root -p status
If the mysql server is actually running it will return output displaying the uptime, number of running threads, and so on. If the server is not running then it will display an error message indicating that the connection to the server failed.
Bill Brooks, Community Moderator
Was your question answered? Make sure to mark the answer as the accepted solution.
If you find a reply useful, say thanks by clicking on the thumbs up button.