Forums

Richard
Richard
Offline
Resolved
0 votes
I use ClearOS 5.1. and was about to install WordPress. I created the WordPress DB and a MySQL account with ALL privileges. I then naively removed ALL grants from root@localhost in PHPMyAdmin (thinking that root@'%' would still retain all grants). Although I can login using root@localhost, I can't do anything!!
Is there a simple way to restore ALL GRANTS privs to root@localhost? If not, do I need to re-install PHPMyAdmin or MYSQL (or both)?

thanks.
Wednesday, July 14 2010, 04:09 AM
Share this post:
Responses (2)
  • Accepted Answer

    Richard
    Richard
    Offline
    Thursday, July 15 2010, 04:20 AM - #Permalink
    Resolved
    0 votes
    Bráulio, Many thanks. Your advice worked perfectly. I just had to FLUSH PRIVILEGES before re-granting privileges to root.
    The reply is currently minimized Show
  • Accepted Answer

    gergull
    gergull
    Offline
    Wednesday, July 14 2010, 06:43 PM - #Permalink
    Resolved
    0 votes
    Hi Richard,

    You need to do following:

    Stop the mysqld process;

    Start mysql by hand with the following command:

    /usr/bin/mysqld_safe --skip-grant-tables

    "This option causes the server to start without using the privilege system at all, which gives anyone with access to the server unrestricted access to all databases."

    Now you can restore the grant privileges. After doing that make sure to stop the server process and start it again the usual way.

    rgrds,
    Bráulio Gergull
    The reply is currently minimized Show
Your Reply