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

Re: lost mysql root password



Thanks everyone for your help, see below for more:

On 3/3/06, anoop aryal <aaryal@foresightint.com> wrote:
> On Friday 03 March 2006 09:49 am, Matt Price wrote:
> > Hi folks,
> >
> > a while ago I switched over to mysql-5.0, then forgot about it
> > entirely.  Now I'm back to configuring some programs that use mysql,
> > and... I can't seem to login as root or any other user.

> if you installed using apt, you should have a file
> called /etc/mysql/debian.cnf . you should be able to use that username and
> password to log in and reset your password.
>

this seemed the simplest of the options presented to me, and
fortunately, voila!  it owrked.  I logged in, and had to use GRSNT
statements to reset permissions:

mysql> grant all privileges on *.* to 'root'@'localhost' identified by
'apassword' with grant option;

that worked fine.  THen I was looking around and I notice that the
user password seemed to have some dublicate rows in it:
+--------------------------------------------------------------+------------------+-------------------------------------------+
| host                                                         | User 
           | Password                                  |
+--------------------------------------------------------------+------------------+-------------------------------------------+
| localhost                                                    | root 
           | hast 1
| anarres                                                      | root 
           | hash 1
|
| localhost                                                    | root 
           | hash 2
| %                                                            | root 
           | hash 2
+--------------------------------------------------------------+------------------+-------------------------------------------+

[passwords are of course hidden in the above]
hmm, that's odd I thought.  what to do?  It got odder when I tried:

select * from user where User='root';

then only the second set of records showed up.  on the other hand,

mysql> select User from user where User LIKE 'root%';

have all four.  I guess there must be some white space in the username
somewhere.  Is there an easy way to identify the precise value of a
mysql field (e.g. by dumping to a CSV file)? I'd like to try to figure
out what went wrong, and deletethe defective lines.

Thanks again for your help, it's so great to have this working.

Matt


>
>
> >
> > I am *not* a cracker, I'm just a little incompetent.
> >
> > APpreciate any help you might give.
> >
> > Thanks,
> >
> > Matt
> >
> >
> > --------------------------
> >  .''`.       Matt Price
> >
> > : :'  :      Debian User
> >
> > `. `'`             & hemi-geek
> >   `-
> > --------------------------
>
> --
>
>
> anoop
> aaryal@foresightint.com
>
>
> --
> To UNSUBSCRIBE, email to debian-user-REQUEST@lists.debian.org
> with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org
>
>



Reply to: