LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 06-26-2005, 09:30 AM   #1
nazir
Member
 
Registered: Apr 2002
Location: Poland, Gliwice/Pszczyna
Distribution: Mandrake, Slackware
Posts: 41

Rep: Reputation: 15
mysql root password lost


Does anyone know how to change mysql's root password?
 
Old 06-26-2005, 12:45 PM   #2
acid_kewpie
Moderator
 
Registered: Jun 2001
Location: UK
Distribution: Gentoo, RHEL, Fedora, Centos
Posts: 43,417

Rep: Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985
yep, there's loads of people that know... did you try google first?

http://openskills.info/infobox.php?ID=1033
http://wiki.wonder.pl/index.php/Mysq...oot%20password
http://www.perturb.org/display/entry/533/
http://www.siliconvalleyccie.com/lin...#_Toc105342544
 
Old 06-26-2005, 01:01 PM   #3
nazir
Member
 
Registered: Apr 2002
Location: Poland, Gliwice/Pszczyna
Distribution: Mandrake, Slackware
Posts: 41

Original Poster
Rep: Reputation: 15
yes, i should try google first, but i was tired looking for some other things
sorry and thanks for help
 
Old 07-15-2005, 11:33 AM   #4
ps2cho
Member
 
Registered: Jun 2005
Posts: 36

Rep: Reputation: 15
Im having this problem and i cant get it to reset.
Iv tried everything on these webpages...Iv tried all three approaches.


-----------------------
server ~ # safe_mysqld --skip-grant-tables &
[1] 10432
server ~ # -bash: safe_mysqld: command not found


----------------------------------


server ~ # /usr/libexec/mysqld -Sg --user=root &
[1] 10433
server ~ # -bash: /usr/libexec/mysqld: No such file or directory


---------------------------------

server ~ # mysqld --skip-grant-tables

This one doesnt even say anything. It just stops.
 
Old 10-08-2007, 02:20 PM   #5
DragonM15
Member
 
Registered: Sep 2003
Location: USA
Distribution: Slackware (Multiple Versions)
Posts: 455

Rep: Reputation: 31
Quote:
Originally Posted by ps2cho View Post
Im having this problem and i cant get it to reset.
Iv tried everything on these webpages...Iv tried all three approaches.


-----------------------
server ~ # safe_mysqld --skip-grant-tables &
[1] 10432
server ~ # -bash: safe_mysqld: command not found


----------------------------------


server ~ # /usr/libexec/mysqld -Sg --user=root &
[1] 10433
server ~ # -bash: /usr/libexec/mysqld: No such file or directory


---------------------------------

server ~ # mysqld --skip-grant-tables

This one doesnt even say anything. It just stops.
What OS are you running? Try 'whereis mysqld' that will give you the location of mysqld... also if you are running slackware, I know there is a script to start the daemon via '/etc/rc.d/rc.mysqld start' Just some thoughts.

DragonM15
 
Old 10-09-2007, 08:54 AM   #6
telakenesys
Member
 
Registered: May 2006
Location: Newcastle, Australia
Distribution: Ubuntu, Raspbian, RaspBMC
Posts: 33

Rep: Reputation: 15
I had the same problem to this I think before. Correct me if I am wrong. You have lost root access to MySQL.

What I ended up doing was to delete the 'mysql' (contains all users and passwords and access) database files and run mysql_install_db

Make sure that you backup first.

This will recreate the 'mysql' database and setup root with no password. This will also delete any access you have currently set for any other users and databases.

This worked for me, hope it is what you are after.
 
Old 10-09-2007, 10:18 AM   #7
DragonM15
Member
 
Registered: Sep 2003
Location: USA
Distribution: Slackware (Multiple Versions)
Posts: 455

Rep: Reputation: 31
I fixed this problem by putting the line:
Code:
SET PASSWORD FOR 'root'@'localhost' = PASSWORD('ThePasswordyouwantforrootaccount');
in a random file, say mysqlpasswordreset

Then running the command mysql_safe --init-file=/pathtopasswordreset/mysqlpasswordreset

This helped me out, I hope it works for others as well.

Later,
DragonM15
 
  


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
lost mysql password, can't recover slackhack Linux - Software 1 12-03-2005 05:15 PM
Lost root password zillah Solaris / OpenSolaris 10 05-24-2005 05:28 PM
Lost Root Password ThaMainframe Mandriva 4 11-12-2004 05:27 PM
lost root password lightningcount Linux - Newbie 9 08-19-2004 06:25 PM
Lost My root password !!! hitesh_linux Linux - General 33 04-14-2003 08:32 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

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