Solved

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

Posted on 2009-07-10
17
861 Views
Last Modified: 2013-11-15
root@Asterisk:~# mysqladmin -u root password password
mysqladmin: connect to server at 'localhost' failed
error: 'Access denied for user 'root'@'localhost' (using password: NO)'
0
Comment
Question by:1030071002
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 9
  • 4
  • 3
  • +1
17 Comments
 
LVL 29

Assisted Solution

by:fosiul01
fosiul01 earned 60 total points
ID: 24824420
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
 

Author Comment

by:1030071002
ID: 24825133
how can you find out your mysqladmin password with out changing it
 
0
 
LVL 14

Assisted Solution

by:fmarzocca
fmarzocca earned 180 total points
ID: 24825174
try with your root password
0
WordPress Tutorial 1: Installation & Setup

WordPress is a very popular option for running your web site and can be used to get your content online quickly for the world to see. This guide will walk you through installing the WordPress server software and the initial setup process.

 
LVL 14

Assisted Solution

by:fmarzocca
fmarzocca earned 180 total points
ID: 24825196
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
 

Author Comment

by:1030071002
ID: 24825291
error: 'Access denied for user 'root'@'localhost' (using password: YES)'
0
 
LVL 14

Assisted Solution

by:fmarzocca
fmarzocca earned 180 total points
ID: 24825456
of course.. you need to type the right password.
0
 

Author Comment

by:1030071002
ID: 24826392
mysql -u root -p
Enter password:
ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: YES)


0
 

Author Comment

by:1030071002
ID: 24826397
how can I reset the password with out knowing it
0
 
LVL 23

Assisted Solution

by:Maciej S
Maciej S earned 260 total points
ID: 24826493
0
 

Author Comment

by:1030071002
ID: 24826661
asterisk-star@Asterisk:~$ /etc/init.d/mysql stop
 * Stopping MySQL database server mysqld                                        cat: /var/run/mysqld/mysqld.pid: Permission denied


0
 

Author Comment

by:1030071002
ID: 24826795
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
 

Author Comment

by:1030071002
ID: 24826828
var/run/mysqld/
mysqld is empty what does that mean
0
 
LVL 23

Assisted Solution

by:Maciej S
Maciej S earned 260 total points
ID: 24827114
You need run every command as root (with sudo in your case).
0
 

Author Comment

by:1030071002
ID: 24827247
i did that
0
 
LVL 23

Assisted Solution

by:Maciej S
Maciej S earned 260 total points
ID: 24830307
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
 

Author Comment

by:1030071002
ID: 24830721
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
 
LVL 23

Accepted Solution

by:
Maciej S earned 260 total points
ID: 24830737
Don't run it twice. First run is enough. After running with --skip-grant-tables option, run rest of commands from above link.
0

Featured Post

[Live Webinar] The Cloud Skills Gap

As Cloud technologies come of age, business leaders grapple with the impact it has on their team's skills and the gap associated with the use of a cloud platform.

Join experts from 451 Research and Concerto Cloud Services on July 27th where we will examine fact and fiction.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

When it comes to protecting Oracle Database servers and systems, there are a ton of myths out there. Here are the most common.
Azure Functions is a solution for easily running small pieces of code, or "functions," in the cloud. This article shows how to create one of these functions to write directly to Azure Table Storage.
Polish reports in Access so they look terrific. Take yourself to another level. Equations, Back Color, Alternate Back Color. Write easy VBA Code. Tighten space to use less pages. Launch report from a menu, considering criteria only when it is filled…
How to Install VMware Tools in Red Hat Enterprise Linux 6.4 (RHEL 6.4) Step-by-Step Tutorial

626 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question