Mysql in Big permission problem

14 posts / 0 new
Last post
#1 Thu, 08/28/2008 - 07:47
sam_webb00

Mysql in Big permission problem

i dont no how this happened but i can not access my mysql database with root, there fore cannot add edit or delete accounts. It appears that the permissions for the user root have gone wrong, and it is not alowed to access the "mysql" table where all of the permissions are kept, so as you can see an endless circle? what do you think the best option would be? to reinstall mysql? any help is very much appreciated

Thu, 08/28/2008 - 12:31
Joe
Joe's picture

I have a rule of thumb about reinstalling things: Don't do it. ;-)

If you don't know how/why something ended up the way it is, you're bound to repeat it...better to figure out what happened, understand it, fix it, and move on, confident that the problem won't occur again--because you know why it happened the first time (or at least know how to fix it, if it turns out some tool you use regularly did the damage).

I've seen one customer system that had root permissions botched by some MySQL GUI tool (I don't think it was phpMyAdmin, though I guess it would be possible...I believe it was some other product, that did it in a more subtle fashion). In that case, a couple of permissions had been removed for the root user.

When you say "cannot access my mysql database with root" what exactly do you mean? Are you trying to use the Webmin MySQL module? The command line? Do you get an error? What is the error (exactly)?

--

Check out the forum guidelines!

Thu, 08/28/2008 - 23:48 (Reply to #2)
David.Strejc

As Joe told you - if you have ''@'localhost' you didn't supply webmin with regular username. It is clear. Try to log into mysql from commandline like:

mysql -p -u root

and type your password there. If you can login you got a problem in virtualmin or better webmin configuration. So try to fix it due to documentation which can be found on this website.

About reinstalling (for Joe ;o) - you can reinstall everything after you have backuped it twice - if I am right - nope?

Sat, 08/30/2008 - 04:52 (Reply to #3)
sam_webb00
Sat, 08/30/2008 - 04:53 (Reply to #4)
Wed, 09/03/2008 - 09:55 (Reply to #5)
sam_webb00

anyone got any ideas, think i might reinstall mysql, or does virtualmin need a reinstall?

Fri, 09/05/2008 - 12:06 (Reply to #6)
allie

how would one reinstall mysql? I was going to delete database but realized it was mysql that was configured wrong but I can't tell what I am not configuring correctly.

Sat, 09/06/2008 - 10:41 (Reply to #7)
allie

I found some info at the mysql forum but can't get around the grant permission statement I keep getting grant is not a command but try googling the error message and maybe it will work for you.

Thu, 08/28/2008 - 12:59
sam_webb00

ok well lets say i want to create a new virtual server i fill in all the details click create server and i get this error
"Failed to create virtual server : DBI connect failed : Access denied for user ''@'localhost' to database 'mysql'"

any ideas?

Thu, 08/28/2008 - 13:32 (Reply to #9)
Joe
Joe's picture

<div class='quote'>&quot;Failed to create virtual server : DBI connect failed : Access denied for user ''@'localhost' to database 'mysql'&quot;</div>

This tells me you've configured the Webmin MySQL module to try to login <i>without</i> a user at all! ;-)

Browse to the Webmin MySQL module...it'll probably present a password dialog, since I doubt it can connect with the details it currently has.

Fill in &quot;root&quot;, and whatever you set your root MySQL password to (this may or may not be the same as the root password of the system--I'd suggest not using the same password, but that's up to you). Save it. See if things look a little more normal.

--

Check out the forum guidelines!

Thu, 08/28/2008 - 16:01
sam_webb00

ok went to webmin module and was already logged in went to module config and set to login as root and with what i assume is the root password considering i dont remember changing it , but then it asks me to fill in the username and password again and it turns out roots password is blank... that cant be good... now i try and edit user privilges while logged in as root (with no password) and i get this error
DBI connect failed : Access denied for user ''@'localhost' to database 'mysql'
on another point
have been using mysqll admin to connect to the database and i get this error when i try and change another users permissions user without any-host (%) entry selected , and it wont let me edit them. hope that narrows it down a bit
thanks again :)

Fri, 08/29/2008 - 07:49
sam_webb00

ok logged in thru ssh and the mysql root user has a blank password, is there anyway i can check what perrmissions the root user has got ?
Thanks for your help

Fri, 08/29/2008 - 13:28 (Reply to #12)
sgrayban

mysql should *never* have a blank password for root *ever*

Go back to the mysql mod and edit the root user and make sure you have a password set for root

Sat, 08/30/2008 - 04:51
sam_webb00

ok i tried to change the password in the webmin module and got this error
Failed to change administration password : DBI connect failed : Access denied for user ''@'localhost' to database 'mysql'

which as some have you said means i am not logging in as root, i have set the module config to login as root with the password staying the same and i still get this error, could the webmin module be broken?
Attacthed are 2 images of what i was trying to do

Topic locked