For mysql, the system administrator user is called root. We will use the mysqladmin utility from a command line to set the new password. Default password is not secured at all. By default in RedHat, Fedora and Centos default password is null. So it is always better to set root password.
To re-set root password, first stop mysql service.
# service mysqld stop
# mysqld_safe –skip-grant-tables
Where,
mysqld_safe = MySQL server startup script
–skip-grant-tables = This enables anyone to connect without a password and with all privileges.
# mysql -u=root mysql;
mysql > update user set Password=PASSWORD(‘new-password’) where user=’root’;
mysql > flush privileges;
mysql > exit;

Related Articles: