[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: mysql dependancy problems.

On Wednesday 22 Mar 2006 11:57, Chris Wakefield wrote:
> Greetings all.
> I've managed to re-install mysql-server-5.0, mysql-client-5.0 and the
> support libraries, etc.  What is happening now is what prompted me to
> uninstall 2 days ago, which is I mistakenly had phpmyadmin remove three
> mysql users: root, a user and the debian system maintainer.  The error I'm
> getting is:
>  ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using
> password: NO)
> Since I can't log in as root, how can I recreate these users?


What's happened is you have messed up the `mysql` database; which is where 
mysql stores all its privilege information  {in a database, naturally}.  You 
need to restore this somehow.  

First of all, make a copy of the directory where mysql is storing its 
databases, this probably will be /var/lib/mysql unless you changed it.

Next, uninstall and purge all the mysql packages; then reinstall them.  This 
will create a brand new setup with a default `mysql` database.

Then, stop mysql; copy the backup you made earlier to /var/lib/mysql  {or 
wherever}, and restart mysql.  It probably will complain and start up slowly, 
but should work.  You might need to FLUSH PRIVILEGES and maybe even do some 

Another method  {if you have another computer or enough disk space to set up a 
temporary chroot}  might be just to copy the mysql.frm, mysql.MYD and 
mysql.MYI files from a working mysql installation into /var/lib/mysql  {while 
the server is stopped, if it is actually starting}.  Then try starting the 

See also the mysql web site.

delta echo bravo six four at earthshod dot co dot uk

Reply to: