Joomla error ' Database Error: Unable to connect to the database:Could not connect to database’

99 views
asked Apr 4, 2012 in Database by redBee (760 points)
hi all,

When browsing my website I get the error, ‘Database Error: Unable to connect to the database:Could not connect to database’, noting that I use Joomla. can anyone help me fix this plz

thanks

3 Answers

0 like 0 dislike
answered Apr 4, 2012 by expert (14,380 points)
You should check the configuration.php file of your Joomla application and make sure the following lines are correct:
var $dbtype = 'mysql';
var $host = 'localhost';
var $user = 'user_jo151';
var $password = 'YourPassword';
var $db = 'user_jo151';
var $dbprefix = 'jos_';
0 like 0 dislike
answered Apr 4, 2012 by dona (4,540 points)
You should make sure you are using the correct MySQL username and database in your configuration.php file.You can use the MySQL Databases tool in your cPanel in order to check the correct username and database for your Joomla.
0 like 0 dislike
answered Apr 4, 2012 by mike231 (2,480 points)
hi

This issue can also be caused by errors within the database itself. In such cases you can try restoring your Joomla database.
...