MySQL question
Niall Kavanagh
NKavanagh at psgroup.com
Tue Feb 22 16:05:46 EST 2000
FYI, this is the reply I sent to the NH list. Might be a bit easier to
understand, and you don't have to move around your access tables.
>From the MySQL docs:
If you have forgotten the root user password for MySQL, you can restore it
with the following procedure.
Take down the mysqld server by sending a kill (not kill -9) to the mysqld
server. The pid is stored in a .pid file which is normally in the MySQL
database directory:
kill `cat /mysql-data-directory/hostname.pid`
You must be either the UNIX root user or the same user the server runs as to
do this.
Restart mysqld with the --skip-grant-tables option.
Connect to the mysqld server with mysql -h hostname mysql and change the
password with a GRANT command. See section 7.26 GRANT and REVOKE syntax. You
can also do this with mysqladmin -h hostname -u user password 'new password'
Load the privilege tables with: mysqladmin -h hostname flush-privileges or
with the SQL command FLUSH PRIVILEGES.
--
Niall Kavanagh (devniall at kst.com)
News, resources, and articles for web professionals and developers:
http://www.kst.com
> -----Original Message-----
> From: John Abreau [mailto:jabr at blu.org]
> Sent: Tuesday, February 22, 2000 3:32 PM
> To: gnhlug at zk3.dec.com
> Cc: discuss at Blu.Org
> Subject: Re: MySQL question
>
>
> On Tue, 22 Feb 2000, Paul Lussier wrote:
>
> >
> > Hi all,
> >
> > Does anyone know how to log into a MySQL database if the
> password you though
> > you set doesn't work ?
> >
> > I'm getting ready to re-install the thing! :)
>
> Look in the scripts/mysql_install_db in the mysql directory.
> This is the
> script that creates the initial authorization tables.
>
> To re-run this, rename data/mysql to something like
> data/mysql_old, then
> run scripts/mysql_install_db. You'll then be able to connect to mysql.
>
> If the old access tables need to be restored, you can edit
> the mysql_old
> to fix your password, and then shutdown the database again,
> remove the new
> data/mysql rename the previously saved data/mysql_old to data/mysql.
> Restart the database and you're all set.
>
>
> --
> John Abreau / Executive Director, Boston Linux & Unix
> Email: jabr at blu.org / URL: http://www.blu.org
> ICQ#28611923 / AIM abreauj
> --------------------------------------------------------------
> ---------
> "Working with NT is like trying to tune a watch wearing oven mitts.
> You can't get your fingers inside like you can with UNIX.
> --------------------------------------------------------------
> ---------
>
> -
> Subcription/unsubscription/info requests: send e-mail with
> "subscribe", "unsubscribe", or "info" on the first line of the
> message body to discuss-request at blu.org (Subject line is ignored).
>
-
Subcription/unsubscription/info requests: send e-mail with
"subscribe", "unsubscribe", or "info" on the first line of the
message body to discuss-request at blu.org (Subject line is ignored).
More information about the Discuss
mailing list