On any platform, you can set the new password using the mysql client (but this approach is less secure):
- Stop mysqld and restart it with the
--skip-grant-tables
option. - Connect to the mysqld server with this command:
shell>
mysql
- Issue the following statements in the mysql client. Replace the password with the password that you want to use.
mysql>
UPDATE mysql.user SET Password=PASSWORD('MyNewPass')
->WHERE User='root';
mysql>FLUSH PRIVILEGES;
root
using the new password.