LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Server
User Name
Password
Linux - Server This forum is for the discussion of Linux Software used in a server related context.

Notices


Reply
  Search this Thread
Old 05-07-2013, 05:33 PM   #1
sniper8752
Member
 
Registered: Oct 2012
Posts: 564

Rep: Reputation: Disabled
reset mysql root account password


How do I reset the mysql root account password? I am running ubuntu.
 
Old 05-07-2013, 05:41 PM   #2
kbp
Senior Member
 
Registered: Aug 2009
Posts: 3,790

Rep: Reputation: 653Reputation: 653Reputation: 653Reputation: 653Reputation: 653Reputation: 653
C'mon .. a tiny bit of searching gives this: http://dev.mysql.com/doc/refman/5.0/...rmissions.html.

Please try to help yourself a little before posting .. if the instructions didn't work for you, then would be a good time to post.
 
Old 05-07-2013, 05:55 PM   #3
sniper8752
Member
 
Registered: Oct 2012
Posts: 564

Original Poster
Rep: Reputation: Disabled
Sorry - should have mentioned, I did try this...

I tried this, but when I do step #2, the last line does not show up for me for the output.

http://www.cyberciti.biz/tips/recove...-password.html

Why does it just hang there? Is it because of the "&" symbol?
 
Old 05-07-2013, 06:30 PM   #4
kbp
Senior Member
 
Registered: Aug 2009
Posts: 3,790

Rep: Reputation: 653Reputation: 653Reputation: 653Reputation: 653Reputation: 653Reputation: 653
Ok.. you should be able to just press the enter key after step 2 to get your prompt back

Last edited by kbp; 05-07-2013 at 06:32 PM.
 
Old 05-08-2013, 01:50 AM   #5
fortran
Member
 
Registered: Nov 2011
Location: Cairo, Egypt
Distribution: CentOS, RHEL, Fedora
Posts: 300
Blog Entries: 2

Rep: Reputation: 51
If you want to reset root password from command line, follow the method described by kbp above.

If you know root password and you want to change it using UI like phpmyadmin (not command line), you can follow this method but this method works if you know the password.
1) Log-into phpmyadmin using root. Root must have password, you can't log into account using blank or no password.
If you do not have root password, log-in with any user who has privileges like root.
2) Open database mysql and open table user.
3) See there should be username root in the list.
4) Now open this site & generate an encrypted password.
5) Put this encrypted password in password field of root in user table of mysql database.
Now you can log-into root with changed password but for this method you must know password of root or any equivalent user who can change the password in user table.
As you said how to reset, you did not request how to recover forgotten password.
 
Old 05-08-2013, 09:33 AM   #6
TB0ne
LQ Guru
 
Registered: Jul 2003
Location: Birmingham, Alabama
Distribution: SuSE, RedHat, Slack,CentOS
Posts: 26,636

Rep: Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965
Quote:
Originally Posted by pavi_kanetkar View Post
If you want to reset root password from command line, follow the method described by kbp above.
If you know root password and you want to change it using UI like phpmyadmin (not command line), you can follow this method but this method works if you know the password.

1) Log-into phpmyadmin using root. Root must have password, you can't log into account using blank or no password.
If you do not have root password, log-in with any user who has privileges like root.
2) Open database mysql and open table user.
3) See there should be username root in the list.
4) Now open this site & generate an encrypted password.
5) Put this encrypted password in password field of root in user table of mysql database.
Now you can log-into root with changed password but for this method you must know password of root or any equivalent user who can change the password in user table.
As you said how to reset, you did not request how to recover forgotten password.
Why would ANYONE go to some website to generate a password? And more importantly, why wouldn't you just use phpmyadmin to change the password directly if you've already got it?? There's already a change password box, and you don't need to enter an 'encrypted' password, since the phpmyadmin tool does that behind the scenes:
http://www.synology.com/support/faq_show.php?q_id=319

OP, have you gotten your prompt back as kbp suggested? If not, you can just SSH to the Linux system, get a root shell, and type in "mysql". At that point, you SHOULD be in MySQL as the root user, and able to follow these directions:
http://en.kioskea.net/faq/630-mysql-...-root-password
http://dev.mysql.com/doc/refman/5.0/...rmissions.html
 
Old 05-08-2013, 11:43 AM   #7
sniper8752
Member
 
Registered: Oct 2012
Posts: 564

Original Poster
Rep: Reputation: Disabled
I was able to recover my root account. I was not able to go in as admin and modify the users. It looks like only a root account user/privileged can perform this task.
 
Old 05-09-2013, 07:11 AM   #8
fortran
Member
 
Registered: Nov 2011
Location: Cairo, Egypt
Distribution: CentOS, RHEL, Fedora
Posts: 300
Blog Entries: 2

Rep: Reputation: 51
Quote:
Originally Posted by TB0ne View Post
Why would ANYONE go to some website to generate a password? And more importantly, why wouldn't you just use phpmyadmin to change the password directly if you've already got it?? There's already a change password box, and you don't need to enter an 'encrypted' password, since the phpmyadmin tool does that behind the scenes:
http://www.synology.com/support/faq_show.php?q_id=319
Ya but by this method user can change his/her password only, if he want to change root's password, he can't do this using phpmyadmin because OP said root has no password and without password OP can't log-in as root in phpmyadmin.

That's why I said if user has root privileges. he can change root's password using UI.
 
Old 05-10-2013, 10:02 AM   #9
TB0ne
LQ Guru
 
Registered: Jul 2003
Location: Birmingham, Alabama
Distribution: SuSE, RedHat, Slack,CentOS
Posts: 26,636

Rep: Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965
Quote:
Originally Posted by pavi_kanetkar View Post
Ya but by this method user can change his/her password only, if he want to change root's password, he can't do this using phpmyadmin because OP said root has no password and without password OP can't log-in as root in phpmyadmin.

That's why I said if user has root privileges. he can change root's password using UI.
...which STILL doesn't explain why he needs to go to a website to generate a password, since if the user HAD root privileges, they wouldn't NEED to generate anything, just click a button. Also, the 'method' works for ANY password, not just a normal users.
 
  


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: still can't login after root password reset andredude Linux - Software 4 12-19-2014 06:30 PM
How to Reset the Root Password of MySQL Hi_This_is_Dev Linux - Server 9 09-22-2010 10:44 AM
Unable to reset mysql root password soylentgreen Linux - Server 5 08-02-2008 10:05 PM
MySQL Root Password Reset carlosinfl Linux - Server 6 07-18-2008 03:58 AM
mysql root password reset. gtum5 LinuxQuestions.org Member Intro 0 03-08-2007 08:57 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Server

All times are GMT -5. The time now is 06:06 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