Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

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

Posted on 2009-07-10
17
Medium Priority
?
874 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 240 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:Fabio Marzocca
Fabio Marzocca earned 720 total points
ID: 24825174
try with your root password
0
NFR key for Veeam Backup for Microsoft Office 365

Veeam is happy to provide a free NFR license (for 1 year, up to 10 users). This license allows for the non‑production use of Veeam Backup for Microsoft Office 365 in your home lab without any feature limitations.

 
LVL 14

Assisted Solution

by:Fabio Marzocca
Fabio Marzocca earned 720 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:Fabio Marzocca
Fabio Marzocca earned 720 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 1040 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 1040 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 1040 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 1040 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

Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

Question has a verified solution.

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

Recently, Microsoft released a best-practice guide for securing Active Directory. It's a whopping 300+ pages long. Those of us tasked with securing our company’s databases and systems would, ideally, have time to devote to learning the ins and outs…
This post looks at MongoDB and MySQL, and covers high-level MongoDB strengths, weaknesses, features, and uses from the perspective of an SQL user.
In this video, Percona Director of Solution Engineering Jon Tobin discusses the function and features of Percona Server for MongoDB. How Percona can help Percona can help you determine if Percona Server for MongoDB is the right solution for …
In this video, Percona Solution Engineer Rick Golba discuss how (and why) you implement high availability in a database environment. To discuss how Percona Consulting can help with your design and architecture needs for your database and infrastr…

722 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