LinuxQuestions.org
Latest LQ Deal: Linux Power User Bundle
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 01-17-2013, 12:24 AM   #1
jddancks
LQ Newbie
 
Registered: Jan 2013
Location: Central NY
Distribution: Mac, debian
Posts: 29

Rep: Reputation: Disabled
Can't set up mysql, get error: 'Access denied for user 'root'@'localhost'


After installing mysql-client and mysql-server I run
Code:
/usr/bin/mysql_install_db
I try to create the root against:

Code:
root@jdd:~# /usr/bin/mysqladmin -u root password '*******'
/usr/bin/mysqladmin: connect to server at 'localhost' failed
error: 'Access denied for user 'root'@'localhost' (using password: NO)'
So what did I forget to do?

system is debian on old powerpc emac

Last edited by jddancks; 01-17-2013 at 11:30 AM.
 
Old 01-17-2013, 03:26 AM   #2
bijo505
Member
 
Registered: Nov 2012
Location: Bangalore
Distribution: Fedora & Ubuntu
Posts: 77

Rep: Reputation: 18
Quote:
Originally Posted by jddancks View Post
After installing mysql-client and mysql-server I run
Code:
/usr/bin/mysql_install_db
I try to create the root against:

Code:
root@jdd:~# /usr/bin/mysqladmin -u root password '*******'
/usr/bin/mysqladmin: connect to server at 'localhost' failed
error: 'Access denied for user 'root'@'localhost' (using password: NO)'
So what did I forget to do?

system is debian on old powerpc emac
Hi Jddancks,

Are you trying to reset the password using mysqladmin? If yes the syntax would be

Code:
root@yetwait:~# mysqladmin -uroot -p password 'Newpasswd'
Enter password: #Here you need to give the old password.
root@yetwait:~#
So after that you can login to the mysql using your new password

Code:
$mysql -u root -p
Or if you forgot the old password, you can reset with the help of below.

Code:
# /etc/init.d/mysql stop
# mysqld --skip-grant-tables --user=root&
# mysql
mysql> use mysql
mysql> update user set Password='' where User='root';
mysql> exit
# killall -9 mysqld
# /etc/init.d/mysql start
# mysql -p
Enter password:
mysql> SET PASSWORD FOR 'root'@'localhost' = PASSWORD('newpassword');
mysql> FLUSH PRIVILEGES;
mysql> exit
Also please have a look at the following URL, that will help you to reset password

http://dev.mysql.com/doc/refman/5.1/...ss-denied.html
http://dev.mysql.com/doc/refman/5.1/...passwords.html

Last edited by bijo505; 01-18-2013 at 03:21 AM. Reason: Masked password in quoted text.
 
1 members found this post helpful.
Old 01-17-2013, 12:02 PM   #3
jddancks
LQ Newbie
 
Registered: Jan 2013
Location: Central NY
Distribution: Mac, debian
Posts: 29

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by bijo505 View Post
Hi Jddancks,

Are you trying to reset the password using mysqladmin? If yes the syntax would be

Code:
root@yetwait:~# mysqladmin -uroot -p password 'Newpasswd'
Enter password: #Here you need to give the old password.
root@yetwait:~#
So after that you can login to the mysql using your new password

Code:
$mysql -u root -p
Or if you forgot the old password, you can reset with the help of below.

Code:
# /etc/init.d/mysql stop
# mysqld --skip-grant-tables --user=root&
# mysql
mysql> use mysql
mysql> update user set Password='' where User='root';
mysql> exit
# killall -9 mysqld
# /etc/init.d/mysql start
# mysql -p
Enter password:
mysql> SET PASSWORD FOR 'root'@'localhost' = PASSWORD('newpassword');
mysql> FLUSH PRIVILEGES;
mysql> exit
Also please have a look at the following URL, that will help you to reset password

http://dev.mysql.com/doc/refman/5.1/...ss-denied.html
http://dev.mysql.com/doc/refman/5.1/...passwords.html
Thanks bijo505. I did the procedure for resetting the password. I messed with my server awhile back, I think it made me create the root account for mysql during the installation process. I thought I would've set it the same as the regular password for root (don't worry I don't plan on launching a website or anything, this is just for fun). I thought I could simply re-install mysql and set it back up after I realized I didn't write it down D:.

also Dijo505, or any mod, if you see this can you please censor the password, I posted this late at night I wasn't thinking.

Last edited by jddancks; 01-17-2013 at 12:33 PM.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
MYSQL: Access denied for user 'root'@'localhost' (using password: NO) jun_tuko Linux - Software 3 03-05-2013 07:37 AM
[SOLVED] mysql ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: 124vikas.dange@gmail.com Linux - Server 4 11-19-2010 02:36 AM
Mysql error 1045: Access denied for user 'root'@'localhost' (using password: YES) visitashu Linux - Server 15 11-11-2010 12:05 AM
mysql server ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using pas tarak420 Linux - Server 2 09-18-2008 10:52 PM
Sarge mysql-server Access denied for user: root@localhost infinity432 Linux - Software 2 05-19-2005 12:42 AM


All times are GMT -5. The time now is 11:46 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration