DBI connect failed : Access denied for user 'root'@'localhost' to database 'mysql'

The command Eric asked you to execute has nothing to do with MySQL, it’s a call to “rpm”, the CentOS package manager. It should not ask you for a password, and you should not need the MySQL root password there!