Solved Delete user root from MySQL?

pinotje

Verified User
Joined
Apr 7, 2010
Messages
41
Location
Maastricht
Hi all,

A while ago I was able to login with the user 'root' to the PHPMyAdmin environment.
At a given moment, I'm unable to login with 'root'.
Since then I login as user 'da_admin' to manage my MySQL-server.

Because I can login with 'da_admin', I don't need 'root' anymore.
Besides the users 'da_admin' and 'root' has exactly the same user rights (ALL PRIVILEGES).

So, will it damage the MySQL-server or PHPMyAdmin if I delete the user 'root'?

Thanks in advance!

Cheers,
Pinotje
 
Last edited:
So, will it damage the MySQL-server or PHPMyAdmin if I delete the user 'root'?
You could, but I would advise against it.
User root has a strong password if all is correct. So even when present, you don't need to use that account.
But if for some reason the da_admin account gets corrupted, deleted or you forget the password, it's easier if you still have the root account to fix things.
I know there is another way to change the root or da_admin pass, but that's more work than just logging in as root and using a mysql command to change a pass or fix something.

So I would say keep the root password.

Eeejj.... I just noticed something. Bis diech ouch 'ne Mestreechteneer, of een Nederlander die in Maastricht woont?
I'm living in Maastricht too.
 
You could, but I would advise against it.
User root has a strong password if all is correct. So even when present, you don't need to use that account.
But if for some reason the da_admin account gets corrupted, deleted or you forget the password, it's easier if you still have the root account to fix things.
I know there is another way to change the root or da_admin pass, but that's more work than just logging in as root and using a mysql command to change a pass or fix something.

So I would say keep the root password.

Eeejj.... I just noticed something. Bis diech ouch 'ne Mestreechteneer, of een Nederlander die in Maastricht woont?
I'm living in Maastricht too.

Thanks for your reply.
Because of your advice, I will keep the user 'root'.

I can view my root password on '/usr/local/directadmin/scripts/setup.txt' (see mysql=******).
Strangely enough I can't log in with that password in PHPMyAdmin anymore, while before I could.
I did not change my root password for MySQL.... Do I have to worry?

Nope, ik ben een Nederlander die voorheen in Maastricht woonde, ik woon nu in Utrecht :)
 
Last edited:
I did not change my root password for MySQL.... Do I have to worry?
I'm not sure. Try from console if you can login to mysql:
mysql -uroot -p
and hit enter. then it will ask for the pass, enter the password. If you can't get in then either, then it's odd. In that case I would change it just to be sure.

If you have a firewall running and port 3306 closed, you might not have to worry, but one can never be 100% sure.

Ah oke, omdat het hier nog in locatie stond. Maar Utrecht is ook een mooie stad. ;)
 
I'm not sure. Try from console if you can login to mysql:
mysql -uroot -p
and hit enter. then it will ask for the pass, enter the password. If you can't get in then either, then it's odd. In that case I would change it just to be sure.

If you have a firewall running and port 3306 closed, you might not have to worry, but one can never be 100% sure.

Ah oke, omdat het hier nog in locatie stond. Maar Utrecht is ook een mooie stad. ;)

Hi Richard,

Thanks for your reply again!
I can successfully login with the command: 'mysql -u root -p'.

Now I understand why I was unable to login with 'root' on PHPMyAdmin.
After I have added the line: "$cfg['Servers'][$i]['AllowRoot'] = true;" to the config file of PHPMyAdmin, then I was able to login with user 'root'.
Apparently AllowRoot was default set to: false.
 
Hello Pinotje.

Apparently AllowRoot was default set to: false.
Ah yes.... that's correct, good you found it. I totally forgot about that because I never login as root with phpmyadmin.
If necessary is use the da_admin user but I almost never need this.

Be aware that if you change that config line and did not copy it to a custom location (don't know from my head how or where) the setting might be overwritten on the next phpmyadmin update.
 
Back
Top