LinuxQuestions.org
Share your knowledge at the LQ Wiki.
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 12-14-2004, 01:40 PM   #1
legendaryfox
LQ Newbie
 
Registered: Apr 2004
Distribution: Fedora Core 1
Posts: 16

Rep: Reputation: 0
Deleted user Root on mysql (phpmyadmin)?


Ehe, did something stupid - while I was in phpmyadmin, i think i accidentally deleted my root user (the one from %) from the users table...and now I can't log into mysql. I tried the Lost Root Password article here, but it doesn't seem to fix it...

The wierd thing is, when I first deleted the root user from the table, nothing happened...but then later, when I tried to run mysql, it said:

ERROR 1045: Access denied for user: 'root@localhost' <Using password: NO>

(tha'ts when i just run plain old mysql)

Then when I try to run it as mysql -p, and after prompting me for a password, it said

ERROR 1045: Access denied for user: 'root@localhost' <Using password: YES>

I know that shouldn't happen, because I remember changing my password to that for the other root account in phpmyadmin...

it's sorta confusing, but if you understand what i mean, please help

Thanks!

Last edited by legendaryfox; 12-14-2004 at 01:46 PM.
 
Old 12-23-2004, 04:12 PM   #2
Hal
Member
 
Registered: Oct 2003
Location: East Anglia, England
Distribution: Dapper Drake / Slackware
Posts: 151

Rep: Reputation: 30
mysql -u root -p password
 
Old 12-23-2004, 04:16 PM   #3
Proud
Senior Member
 
Registered: Dec 2002
Location: England
Distribution: Used to use Mandrake/Mandriva
Posts: 2,794

Rep: Reputation: 116Reputation: 116
Check that gap after the -p, iirc it shouldnt be there.
 
Old 12-23-2004, 06:27 PM   #4
cherylchase
LQ Newbie
 
Registered: Dec 2004
Location: California
Distribution: RHEL3
Posts: 13

Rep: Reputation: 0
If the root user has actually been deleted from the mysql database's users table, then the above suggestion won't work. (But if it did work, it would be mysql -uroot -ppassword, without any spaces).

The lost password article you pointed to gives correct instructions for changing root's password. But that won't work, I think, if the root user doesn't exist.

Do you have a backup of the mysql database files? You can stop the mysql process and just overwrite the mysql database files. They are someplace like /var/lib/mysql/mysql. You can find them with locate host.frm if you are not sure.

Another possibility would be to extract a set of pristine mysql database files from a new distribution.

Last edited by cherylchase; 12-23-2004 at 06:40 PM.
 
Old 01-09-2005, 01:12 PM   #5
tcarroll2
LQ Newbie
 
Registered: Jan 2005
Location: Honolulu, HI
Distribution: SME Server (Redhat)
Posts: 1

Rep: Reputation: 0
MySQL users deleted

Alright, I too have this problem of all users being deleted.

I tried doing what you suggested of stopping the mysql server and copying files over the database files in /var/lib/mysql/mysql from a previous installation. No luck.

I still cannot access any of the mysql databases. I cannot manipulate any users either, such as trying to add the root user, or at least change the privileges or password.

Thank you!
 
  


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
Urgent! Deleted Root! goosie Mandriva 12 06-30-2005 07:50 PM
Deleted User... Sonshyne Linux - Newbie 1 06-23-2004 05:53 PM
root account Deleted chandu Linux - Security 1 06-18-2004 12:47 PM
i deleted my user jonesnm Fedora 1 05-20-2004 10:20 AM
Deleted root user france Linux - Newbie 1 04-30-2004 06:57 AM

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

All times are GMT -5. The time now is 07:00 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
Open Source Consulting | Domain Registration