Question

I have been messing around trying to solve this problem for awhile now and I probably messed something up. I have been going around the forums and nothing has been working. First I forgot my password to root and used the command --skip-grant-tables to try to change it. I am able to login into root now on phpmyadmin with my password just being empty. On phpmyadmin it shows User: root@localhost. Then when I try to create a new database there is only a red x and is says No Privileges.

Also if I try to create a password to root I get an error that says - Can't find any matching row in the user table.

I saw on a forunm that said to run this code select Host, User, Select_priv from mysql.user
but what I get it SELECT command denied to user ''@'localhost' for table 'user'

thanks for the help.

Was it helpful?

Solution

The following command can be used to set the password for the root user and grant all privileges:

UPDATE mysql.user SET Password=PASSWORD('NewPasswordHere') WHERE User='root';
GRANT ALL PRIVILEGES ON *.* TO 'root'@'localhost';
FLUSH PRIVILEGES;

Place this SQL code into a text file and save it some place convenient. Then, kill the SQL server. Open a command prompt and cd to the directory where the mysql-nt executable is stored. Execute this command:

mysqld-nt --init-file=sql-file-saved-above.txt

Kill the SQL process you just started and restart the server normally and all should be good. Depending on how you have phpMyAdmin configured, you might need to adjust its configuration if you have the root password saved there.

OTHER TIPS

your best option is to set add a new user with a password and grant FULL privildeges, on you connection use the new user

Open PhpMyAdmin

select "Users" underneath the know users is the option "add user"

add login information as required

tick the 2 boxes in the "database for users section"

now "Check All" in the Global privideges and click go, new user is then set up and you can use it as your new connection

go to Php My Admin home page of wamp

At the very top in grey you can see your connection is "localhost" Underneath where you see your connection is local, are 10 tabs which are......

Databases | SQL | Status | Users | Export | Import | Settings | Binary log | Replication | More

as you can see option 4 is "Users"

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top