views:

613

answers:

3

My computer is Windows XP. I need to find this file to get all privileges back to the root user. I accidentally removed some privileges of the root user. I still have the password and there is no problem for me to log in to MySQL as the root user. But I can not alter a table.

A: 

Start->Search->For Files and Folders->All Files and Folders

type "my.cnf" and hit search.

Jeremy Morgan
A: 

you can search this file : resetroot.bat

just double click it so that your root accout will be reset and all the privileges are turned into YES

Treby
+1  A: 

To answer your question, on Windows, the my.cnf file may be called my.ini. MySQL looks for it in the following locations (in this order):

  • %WINDIR%\my.ini, %WINDIR%\my.cnf
  • C:\my.ini, C:\my.cnf
  • INSTALLDIR\my.ini, INSTALLDIR\my.cnf

See also http://dev.mysql.com/doc/refman/5.1/en/option-files.html

Then you can edit the config file and add an entry like this:

[mysqld]
skip-grant-tables

Then restart the MySQL Service and you can log in and do what you need to do. Of course you want to disable that entry in the config file as soon as possible!

See also http://dev.mysql.com/doc/refman/5.1/en/resetting-permissions.html

Bill Karwin