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

[cobalt-users] Re: RaQ4 MySQL Lost root password



> I lost the root password for MySQL.
>I first of all did :
> /etc/rc.d/init.d/mysql stop
> Then I did this:
> [root /]# /usr/sbin/mysqld --skip-grant-tables
> Fatal error: Please read "Security" section of the manual to find out how
to
> run mysqld as root!
> 011203 17:29:11  Aborting
> 011203 17:29:11  /usr/sbin/mysqld: Shutdown Complete

I noticed no one seems to know the answer so I looked through the manual and
the only thing I could guess at from what it says:
1. 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. ***

2. Restart mysqld with the --skip-grant-tables option.
3. 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'
4. Load the privilege tables with: mysqladmin -h hostname flush-privileges
or with the SQL command FLUSH PRIVILEGES

is that maybe you could try doing it as the same user the server runs on,
seeing as doing it as root didnt help.
Sorry couldnt be more use and I just realised I have no idea what my root
password is! :)
Jim