Fedora Linux Support Community & Resources Center
  #1  
Old 4th February 2010, 10:46 AM
SeraphimNL Offline
Registered User
 
Join Date: Dec 2009
Location: Leeuwarden
Posts: 9
linuxfedorafirefox
Unhappy Reset SQL root password

Hey there,


I am trying to set up a webserver with apache, mysql and php on a old pentrium 4 computer. When I tried to setup my MySQL password, I created a password with punctuation in it. MySQL didn't want the password and gave some error about BASH. I tried changing my password again but now I constantly get the error that I am unable to login. I tried all the possibilities with the password I entered before but i just can't login to MySQL anymore. I found some help sites on how to reset your password by running MySQL in the safe mode but that didn't work for me. Can anyone help me resetting my password? Next time i'll use a pass without punctuation Every help is much appreciated! BTW, I also tried uninstalling MySQL with yum (yum remove mysql) and it uninstalled, but when I installed it again the password was still there

Thanks in advance!

Last edited by SeraphimNL; 4th February 2010 at 11:04 AM.
Reply With Quote
  #2  
Old 5th February 2010, 01:30 AM
madhavdiwan Offline
Registered User
 
Join Date: Jun 2009
Posts: 472
windows_xp_2003firefox
if you dont mind removing mysql and all of the database's and files you've created this is easy,

yum remove mysql
go to /var/lib/mysql directory and delete all files you find there ..
yum install mysql

next time you run into this , its a good idea to set up at least two administrative accounts on any database system. (and never use one of them until something like this happens)
usually for mysql .. i have the root account .. which is the root user and its password.. and then my own account set up as an administrator in mysql with all of the privileges.. then each app gets its own administrator with privileges for only its own database.
Reply With Quote
  #3  
Old 6th February 2010, 09:41 AM
SeraphimNL Offline
Registered User
 
Join Date: Dec 2009
Location: Leeuwarden
Posts: 9
linuxfedorafirefox
Thank you man! It worked

Gonna make a extra user account asap

Thanks for the help!

Last edited by SeraphimNL; 6th February 2010 at 09:53 AM.
Reply With Quote
  #4  
Old 6th February 2010, 12:09 PM
smr54 Online
Registered User
 
Join Date: Jan 2010
Posts: 4,976
linuxopera
A simpler way that doesn't involve removing everything should be. (Untested in awhile, who knows if it's changed?)

/usr/libexec/mysqld --skip-grant-tables --user=root

UPDATE mysql.user SET Password=PASSWORD('newpassword') WHERE User='root';

FLUSH PRIVILEGES;
quit

(In MySQL 4, after starting mysqld it was

USE mysql
UPDATE user
SET password=password("newpass")
WHERE user="root";
Reply With Quote
  #5  
Old 6th February 2010, 01:06 PM
leigh123linux's Avatar
leigh123linux Offline
Retired Administrator
 
Join Date: Oct 2006
Posts: 21,509
linuxfedorafirefox
Quote:
Originally Posted by smr54 View Post
A simpler way that doesn't involve removing everything should be. (Untested in awhile, who knows if it's changed?)

/usr/libexec/mysqld --skip-grant-tables --user=root

UPDATE mysql.user SET Password=PASSWORD('newpassword') WHERE User='root';

FLUSH PRIVILEGES;
quit

(In MySQL 4, after starting mysqld it was

USE mysql
UPDATE user
SET password=password("newpass")
WHERE user="root";


Or

Code:
su
service mysqld stop
mysqld_safe --skip-grant-tables
from another terminal

Code:
mysql -u root mysql
UPDATE mysql.user SET Password=PASSWORD('newpassword') WHERE  User='root'; 
FLUSH PRIVILEGES; 
quit
su
service mysqld restart
Reply With Quote
Reply

Tags
mysql, password, webserver

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

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 On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
forgot root password, how to reset? gala_dragos Using Fedora 8 18th January 2008 09:29 PM
Root password reset Rautamiekka Security and Privacy 17 14th November 2006 02:16 AM
Root password Reset LCR Security and Privacy 15 29th September 2006 05:43 AM
Trying to reset root password. BoomerFZ1 Using Fedora 2 7th April 2005 12:04 AM


Current GMT-time: 06:57 (Sunday, 19-05-2013)

TopSubscribe to XML RSS for all Threads in all ForumsFedoraForumDotOrg Archive
logo

All trademarks, and forum posts in this site are property of their respective owner(s).
FedoraForum.org is privately owned and is not directly sponsored by the Fedora Project or Red Hat, Inc.

Privacy Policy | Term of Use | Posting Guidelines | Archive | Contact Us | Founding Members

Powered by vBulletin® Copyright ©2000 - 2012, vBulletin Solutions, Inc.

FedoraForum is Powered by RedHat