>>>>> "Hiu-Man" == Hiu-Man Cheung <cheung@stripped> writes:
Hiu-Man> I've to access a mysql database on a SUN solaris box but I don't have the
Hiu-Man> password. Old employee took it with him. Is there a way I can go in and
Hiu-Man> reset the password?
Hiu-Man> Also I'm getting the following error:
Hiu-Man> bash-2.03# /usr/local/mysql/bin/mysqlshow
Hiu-Man> /usr/local/mysql/bin/mysqlshow: Access denied for user: 'root@localhost'
Hiu-Man> (Using password: NO)
Hiu-Man> I'm accessing this database on the server.
Hiu-Man> This machine used to have a name but now doesn't. Does it matter?
I just updated the MySQL manual with the following:
'How to reset a forgotten password.'
If you have forgot the root password for MySQL, you can restore this
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`
- Restart 'mysqld' with --skip-grant-tables.
- Connect to the mysqld server with 'mysql -h hostname mysql' and change
the password with a 'GRANT' command.
You can also do this with
mysqladmin -h hostname -u user password 'new password'
- Load the privilege tables with: 'mysqladmin -h hostname flush-tables' or
with the SQL command 'FLUSH PRIVILEGES'.