
23-05-2009
|
Member | | Join Date: May 2008
Posts: 2,008
| |
Re: How to reset mysql password? Following are the steps for resetting password in Unix environment: - Log on to your system as either the Unix root user or as the same user that the mysqld server runs as
- Locate the .pid file that contains the server's process ID. The exact location and name of this file depend on your distribution, hostname, and configuration. Common locations are /var/lib/mysql/, /var/run/mysqld/, and /usr/local/mysql/data/.You can stop the MySQL server by sending a normal kill (not kill -9) to the mysqld process, using the pathname of the .pid file in the following command:
Quote:
shell> kill `cat /mysql-data-directory/host_name.pid`
| - Restart the MySQL server with the special --skip-grant-tables option:
Quote:
shell> mysqld_safe --skip-grant-tables &
| - Set a new password for the root@localhost MySQL account:
Quote:
shell> mysqladmin -u root flush-privileges password "newpwd"
| Replace "newpwd'' with the actual root password that you want to use.
|