If you are having your server root login details then follow following steps carefully from shell.
1st login in to shell as root user now run command( For example I am using site/domain name as test.com and user test.
It will give you user name, now switch to user account.
Now you are in test user home directory under which all hosting files are present.
Run command to search database user and password.
grep test_ * -R -l
Above command will show you all files under which database name/user name is defined.
Now you have to open config file, you have received after running above command.
One config file open search for database user name and password.
login in to cPanel select mysql database feature and add database user with the password which you have found out in config files and reassigned privilege for newly added database user to existing database.
Could you not, I don't know... just look into the configuration (config.php) of said script to obtain current MySQL password?
Example, if you lost your database details for a Wordpress blog, just look up the details in the config.php and save yourself the hassle of having to change that exact same line of information after you've made the update.
The database does not physically have a password, it is the user assigned to the database that uses the password, if you are using cPanel simply remove the user from the database and then re-create that user with another password.
You can change the passwords as required within phpMyAdmin or view the config.php as recommended.
██ l Clever Emu (Twitter) • Shared • Reseller • Cloud VPS • Since 2003
██ l Leading UK and Ireland Hosting Provider • Multiple locations - around the globe!
██ l cPanel/WHM • R1Soft Backups • 24/7/365 Support • 99.9% Uptime Guarantee
██ l www.yourcompanynamehere.com • Customer Service Rep. • Superior Service Guarantee