For whatever reason you may encounter this type of problem with your database password after installing wordpress on linux here is a solution….
Open up the terminal and follow these steps of commands,
sudo /etc/init.d/mysql stop
sudo mysqld –skip-grant-tables &
mysql -u root mysql
Replace YOURNEWPASSWORD with your new password!
UPDATE user SET Password=PASSWORD(‘YOURNEWPASSWORD’) WHERE User=’root’; FLUSH PRIVILEGES; exit;
Note: This method is not regarded as the securest way of resetting the password. However it works.