0

I accidentally locked myself out by creating a new user account (with what I thought had full privileges) and deleting root altogether instead of editing it. I'm not the brightest bulb in the box sometimes.

Basically, how can I restore my full user privileges -- either by restoring everything to default or modifying my current configuration for SQLBuddy?

I've looked online and I'm having trouble finding an appropriate solution.

HB-
  • 635
  • 2
  • 8
  • 21

1 Answers1

0

Woops, you are not having a good time recently are you.

  • Stop the mysql service

    wampmanager -> MySQL -> Service -> Stop Service

  • Edit the my.ini file

    wampmanager -> MySQL -> my.ini

  • Find the [wampmysqld] section in the ini file

    Add this line directly after the section [wampmysqld]

    skip-grant-tables

  • Restart the mysql service.

    wampmanager -> MySQL -> Service -> Start/Resume Service

  • Open the MySQL console

    wampmanager -> MySQL -> MySQL Console

    just hit enter when asked for the password.

Now we are going to give all privilages to your new account.

enter the following 2 commands at the mysql> command prompt, each with a semi colon at the end of a line, and press ENTER after each line to issue the command to mysql.

GRANT ALL PRIVILEGES ON *.* TO 'Your_Userid'@'localhost' WITH GRANT OPTION;

FLUSH PRIVILEGES;

Note If you created this new user with more than one domain i.e. xxx@localhost and xxx@127.0.0.1 you should do this for each domain

  • Now enter 'quit' at the mysql command promt to exist mysql.

  • Stop the mysql service

    wampmanager -> MySQL -> Service -> Stop Service

  • Edit the my.ini file

    wampmanager -> MySQL -> my.ini

  • Find the [wampmysqld] section in the ini file

    Remove the 'skip-grant-tables' parameter we added earlier. DO NOT Leave this parameter in the ini file its a HUGH security hole.

  • Restart the mysql service. wampmanager -> MySQL -> Service -> Start/Resume Service

You should now be able to login with phpmyadmin or SQLBuddy using your new useridand the new password you have just set for that user.

RiggsFolly
  • 93,638
  • 21
  • 103
  • 149