[Watford] MySQL - Help

Alain Williams addw at phcomp.co.uk
Wed Feb 27 17:15:10 GMT 2008


On Wed, Feb 27, 2008 at 05:01:01PM -0000, Walt wrote:
> Hi Everyone,
> 
> I have mucked up my MySQL server.  I removed (by mistake) the root user for
> admin purposes using MySQL WebAdmin and I cannot now access any of my
> databases now. All I get is 'access denied'.
> 
> So I really do need some guidance.  If I have learned anything in Linux then
> its that there is always a file somewhere that can be edited to rectify a
> problem such as this. I have checked the MySQL website but its too technical
> for me. I have tried the MySQL command line tool but there is no command (as
> far as I can tell) to setup new privileges with user and password.

Close the database server.
The database tables are prob kept in a directory like /var/lib/mysql
(depends on what distro you run).

There is one directory per database, the database that interests you
is the mysql one. In there the 'user' table is where root's details were kept.
Restore from backup the files user.MYD and user.MYI and user.frm
Restart the database server and you should be back in business.

-- 
Alain Williams
Linux Consultant - Mail systems, Web sites, Networking, Programmer, IT Lecturer.
+44 (0) 787 668 0256  http://www.phcomp.co.uk/
Parliament Hill Computers Ltd. Registration Information: http://www.phcomp.co.uk/contact.php
Chairman of UKUUG: http://www.ukuug.org/
#include <std_disclaimer.h>



More information about the Watford mailing list