Set the Root Password

On April 29, 2005, in MySQL, by Brad

After installing MySQL, the first thing you’ll want to do is reset the root password for MySQL. You can achieve this using the following command:

[root@myhost]# mysqladmin -u root password new-password

Set MySQL to start automatically with the following command

[root@myhost]# /sbin/chkconfig mysqld on

Update:
A much better way to secure your installation of MySQL is to run the mysql_secure_installation command. This prompts you to set or change the root password, remove guest access and test databases, etc.