'Access denied for user 'root'@'localhost' (using password: NO)'

$ mysqladmin -u root -p password
Enter password: 
New password: 
Confirm new password:

password is to be typed literally. It's a command. You don't have to substitute password with your actual password.


# /etc/init.d/mysqld stop

Stopping MySQL: [ OK ]

# mysqld_safe --skip-grant-tables &

[1] 13694

# Starting mysqld daemon with databases from /var/lib/mysql



# mysql -u root

Welcome to the MySQL monitor. Commands end with ; or \g.

Your MySQL connection id is 1

Server version: 5.0.77 Source distribution



Type 'help;' or '\h' for help. Type '\c' to clear the buffer.



mysql>

Set/Change password:

mysqladmin -u root -p password

Login to MySQL console:

mysql -u root -p

To exit the console:

.\q

when trying to run this command i got the same error

sudo mysqladmin create asteriskcdrdba

i simply add a few lines to the code

-u root -p

and pressed the enter key. i then typed my password and hit enter. Linux liked my command as nothing more was displayed

so maybe try

sudo <your command here> -u <username> -p

after that hit enter and enter your password