Solved

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

Posted on 2009-07-10
17
826 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
  • 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
 
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
How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

 
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

What Should I Do With This Threat Intelligence?

Are you wondering if you actually need threat intelligence? The answer is yes. We explain the basics for creating useful threat intelligence.

Join & Write a Comment

This article describes some very basic things about SQL Server filegroups.
CCModeler offers a way to enter basic information like entities, attributes and relationships and export them as yEd or erviz diagram. It also can import existing Access or SQL Server tables with relationships.
Video by: Steve
Using examples as well as descriptions, step through each of the common simple join types, explaining differences in syntax, differences in expected outputs and showing how the queries run along with the actual outputs based upon a simple set of dem…
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…

760 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

Need Help in Real-Time?

Connect with top rated Experts

18 Experts available now in Live!

Get 1:1 Help Now