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

I have a rule of thumb about reinstalling things: Don’t do it. :wink:

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)?

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?

"Failed to create virtual server : DBI connect failed : Access denied for user ''@'localhost' to database 'mysql'"

This tells me you’ve configured the Webmin MySQL module to try to login without a user at all! :wink:

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 “root”, 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.

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 :slight_smile:

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?

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

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

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

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

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.

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.