Root Privileges Removed Accidently Please Help

Problems with the Windows version of XAMPP, questions, comments, and anything related.

Root Privileges Removed Accidently Please Help

Postby richyboy » 20. January 2008 23:18

Hi there
i have managed to remove all privileges from the root account using myphpadmin and now one of my sites is no longer working. I just get a message back stating that the site is offline.

The reason I was messing around is because it became apparent that my installation of XAMPP was very insecure. I actually got an email from someone giving me a heads up. In addition to this I Now cannot get any access to any of my databases although I did manage to password protect the root account using XAMP which is what I was trying to do in the first place!!!!

Can someone help me restore these privileges

Thanks!

Richy
richyboy
 
Posts: 2
Joined: 20. January 2008 23:07

Postby LooseCannon » 21. January 2008 18:25

Hello and welcome richyboy.

Please confirm that I understand the situation: You _do_ have root access, ie know root's password, but have removed/lost _some_ of root's MySQL global privileges and/or permissions to access certain databases and/or tables?

Does the root user have any privileges or permissions with the MySQL database and tables? In other words, if you get onto phpmyAdmin (assuming you can - see above), you _can_ at least see a database called MySQL?

I believe users' access/rights regarding MySQL databases/tables are held in the database called "MySQL", so you'll need at least some access thereto.

Note: I find the program SQLyog more user friendly for managing users. Have a look here: http://www.webyog.com/en/downloads.php

Please let us know how you get on.
User avatar
LooseCannon
 
Posts: 162
Joined: 18. September 2007 12:07
Location: Hampshire, UK

Postby richyboy » 21. January 2008 19:05

Hi there

Thanks for replying!

Yes you are correct I can log in to Myphpadmin but I dont have access to any databases all I can see is information_schema.

underneath 'Create New Database' it states No privileges

If I could create a new user and grant max privs then I guess that would fix the issue?

Thanks

Richard
richyboy
 
Posts: 2
Joined: 20. January 2008 23:07

Postby Dave_L » 22. January 2008 01:20

You might try this: http://dev.mysql.com/doc/refman/5.0/en/ ... ns-windows

I suggest backing up your databases first (the contents of the xampp/mysql/data directory).
User avatar
Dave_L
 
Posts: 212
Joined: 23. October 2004 00:43

Postby LooseCannon » 23. January 2008 14:11

I believe one needs GRANT rights to create a user as you suggest. I'd guess that only root has (or had) that right, so you can't even started down that route. ,,, I guess.

Give Dave_L's link a try and let us know how you do.

+1 for backups. ... You haven't got any from before have you?
User avatar
LooseCannon
 
Posts: 162
Joined: 18. September 2007 12:07
Location: Hampshire, UK

Postby Dave_L » 23. January 2008 21:13

I misunderstood your post. If you can log in as root, but the root user has no privileges, this might work:

http://forums.mysql.com/read.php?30,137 ... #msg-62421

An alternative approach (messy, but effective) is to create another mysql install (using same version of mysql), then copy the "mysql" database (xampp/mysql/data/mysql) to the new install as "mysql1".

In the new install: Using phpmyadmin, add a new user with full (root) privileges in that install. Note the actual query that phpmyadmin uses. Duplicate that query for the "mysql1" database.

Copy the "mysql1" database from the new install to the "mysql" database in the old install. Since the new user now has full privileges, you can use it to restore the original root user's privileges.
User avatar
Dave_L
 
Posts: 212
Joined: 23. October 2004 00:43


Return to XAMPP for Windows

Who is online

Users browsing this forum: No registered users and 44 guests