mysqladmin: connect to server at ‘localhost’ failed

In this article, we will see the solution for below error.

>mysqladmin: connect to server at 'localhost' failed error: 'Access denied for user 'root'@'localhost' (using password: YES)'

Reason: We missed the password option ‘-p’ and provide username with name space after -u.

Solution:

Try with without space between -u and username.

mysqladmin -u root -p shutdown