LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Home Forums Tutorials Articles Register
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-16-2013, 11:24 PM   #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 10:30 AM.
 
Old 01-17-2013, 02: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 02:21 AM. Reason: Masked password in quoted text.
 
1 members found this post helpful.
Old 01-17-2013, 11:02 AM   #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 11:33 AM.
 
  


Reply



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 06: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 01:36 AM
Mysql error 1045: Access denied for user 'root'@'localhost' (using password: YES) visitashu Linux - Server 15 11-10-2010 11:05 PM
mysql server ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using pas tarak420 Linux - Server 2 09-18-2008 09:52 PM
Sarge mysql-server Access denied for user: root@localhost infinity432 Linux - Software 2 05-18-2005 11:42 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 05:26 PM.

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
Open Source Consulting | Domain Registration