'Access denied for user 'root'@'localhost'

root@Asterisk:~# mysqladmin -u root password password
mysqladmin: connect to server at 'localhost' failed
error: 'Access denied for user 'root'@'localhost' (using password: NO)'
1030071002Asked:
Who is Participating?

[Webinar] Streamline your web hosting managementRegister Today

x
 
Maciej SConnect With a Mentor sysadminCommented:
Don't run it twice. First run is enough. After running with --skip-grant-tables option, run rest of commands from above link.
0
 
fosiul01Connect With a Mentor Commented:
mysqladmin -u root password password

its if you want to set the password for the first time to mysql server

by looking error its looks your mysql server has already root password setup

if you want to change the password

mysqladmin -u root -p'oldpassword' password newpass
0
 
1030071002Author Commented:
how can you find out your mysqladmin password with out changing it
 
0
Never miss a deadline with monday.com

The revolutionary project management tool is here!   Plan visually with a single glance and make sure your projects get done.

 
Fabio MarzoccaConnect With a Mentor FreelancerCommented:
try with your root password
0
 
Fabio MarzoccaConnect With a Mentor FreelancerCommented:
I don't understand your mysqladmin syntax...

To access mysql, just type

mysql -u root -p

while, for mysqladmin, the syntax is:

 mysqladmin [options] command [command-options]

0
 
1030071002Author Commented:
error: 'Access denied for user 'root'@'localhost' (using password: YES)'
0
 
Fabio MarzoccaConnect With a Mentor FreelancerCommented:
of course.. you need to type the right password.
0
 
1030071002Author Commented:
mysql -u root -p
Enter password:
ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: YES)


0
 
1030071002Author Commented:
how can I reset the password with out knowing it
0
 
1030071002Author Commented:
asterisk-star@Asterisk:~$ /etc/init.d/mysql stop
 * Stopping MySQL database server mysqld                                        cat: /var/run/mysqld/mysqld.pid: Permission denied


0
 
1030071002Author Commented:
asterisk-star@Asterisk:~$ sudo /etc/init.d/mysql stop
 * Stopping MySQL database server mysqld                                 [ OK ]
asterisk-star@Asterisk:~$ mysqld_safe --skip-grant-tables &
[2] 858
asterisk-star@Asterisk:~$ nohup: ignoring input and redirecting stderr to stdout
Starting mysqld daemon with databases from /var/lib/mysql
mysqld_safe[897]: started
STOPPING server from pid file /var/run/mysqld/mysqld.pid
mysqld_safe[907]: ended
mysql -u root
ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock' (2)
[2]-  Done                    mysqld_safe --skip-grant-tables


0
 
1030071002Author Commented:
var/run/mysqld/
mysqld is empty what does that mean
0
 
Maciej SConnect With a Mentor sysadminCommented:
You need run every command as root (with sudo in your case).
0
 
1030071002Author Commented:
i did that
0
 
Maciej SConnect With a Mentor sysadminCommented:
I don't think so :)
asterisk-star@Asterisk:~$ sudo /etc/init.d/mysql stop
* Stopping MySQL database server mysqld                                 [ OK ]
asterisk-star@Asterisk:~$ mysqld_safe --skip-grant-tables &
[2] 858

I don't see 'sudo' in third line. Please run _all_ these commands (from the link above) again. This time, run them as root.
0
 
1030071002Author Commented:
root@Asterisk:/tmp# cd ..
root@Asterisk:/# sudo mysqld_safe --skip-grant-tables &
[1] 16661
root@Asterisk:/# nohup: ignoring input and redirecting stderr to stdout
mysqld_safe[16706]: A mysqld process already exists
root@Asterisk:/tmp# cd ..
root@Asterisk:/# sudo mysqld_safe --skip-grant-tables &
[1] 16661
root@Asterisk:/# nohup: ignoring input and redirecting stderr to stdout
mysqld_safe[16706]: A mysqld process already exists


0
All Courses

From novice to tech pro — start learning today.