Solved

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

Posted on 2009-07-10
17
836 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
Microsoft Certification Exam 74-409

Veeam® is happy to provide the Microsoft community with a study guide prepared by MVP and MCT, Orin Thomas. This guide will take you through each of the exam objectives, helping you to prepare for and pass the examination.

 
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

VMware Disaster Recovery and Data Protection

In this expert guide, you’ll learn about the components of a Modern Data Center. You will use cases for the value-added capabilities of Veeam®, including combining backup and replication for VMware disaster recovery and using replication for data center migration.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
C# Application Local DB Connection String 23 170
t-sql sp_addlinkedserver possible risks 3 69
Update in Sql 7 37
compare between entities in entity framework 8 72
The purpose of this article is to show how we can create Linux Mint virtual machine using Oracle Virtual Box. To install Linux Mint we have to download the ISO file from its website i.e. http://www.linuxmint.com. Once you open the link you will see …
The purpose of this article is to fix the unknown display problem in Linux Mint operating system. After installing the OS if you see Display monitor is not recognized then we can install "MESA" utilities to fix this problem or we can install additio…
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…

773 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