If you Forgot your MySQL Root Password...
Novell Cool Solutions: Trench
By Rodney Crossman
Digg This -
Posted: 5 Jul 2005
"Great Tip! I would have liked to have known this in the past."
Forgot your MySQL root password and don't want to lose existing data by reinstalling? Since MySQL on NetWare (and other platforms) currently doesn't use eDirectory for authentication and instead uses its own internal user/auth system, forgetting your root password months after doing your install can be a major headache. A perfect example of this is doing a full NetWare 6.5 install with MySQL, exteNd, and Novell Audit which all ask for passwords. You should be writing these all down as you do the install <g>, but sometimes a person just forgets and then months later decides to start actually testing or using these apps that depend on MySQL, or the admin simply wants to setup a new MySQL database for different purposes but needs MySQL root access to do so.
Don't sweat, fixing this is actually fairly easy. The documentation for MySQL notes that you can skip the MySQL authentication system on loadtime using the '--skip-grant-tables' load command. With MySQL loaded with no security, you can use either a MySQL admin gui or the MySQL commandline to reset your root password.
You can find the MySQLadmin tool from http://dev.MySQL.com/downloads/administrator/1.0.html, or you can use the Novell-included phpMyAdmin on your own server. (Easier for those who don't understand the MySQL commandline.)
The full command to load MySQL like this is:
mysqld_safe --skip-grant-tables --autoclose
(Editor's Note: Our technical reviewer found that he had to launch the mysqld_safe command without the '--autoclose' flag, otherwise the daemon never started.)
Once you have reset your password using your chosen MySQL admin tool, don't forget to immediately unload mysqld and reload it normally, as loading with that command leaves it wide open as root to any connections and is therefore a major security risk.
Hope this helps others.
If you have any questions you may contact Rodney at firstname.lastname@example.org
Novell Cool Solutions (corporate web communities) are produced by WebWise Solutions. www.webwiseone.com