0

I upgrade my xampp to 1.8 from 1.7 by uninstalling 1.7 but did not uninstall the htdocs and mysql data folder. But my problem now is that my site are not displaying, my joomla 2.5 sites give: Database connection error (3): Could not connect to database, while joomla 1.5 sites give errors such as:

Strict Standards: Non-static method JLoader::import() should not be called statically in C:\xampp\htdocs\osu\libraries\joomla\import.php on line 29

Strict Standards: Non-static method JLoader::register() should not be called statically in C:\xampp\htdocs\osu\libraries\loader.php on line 71

Strict Standards: Non-static method JLoader::import() should not be called statically in C:\xampp\htdocs\osu\libraries\joomla\import.php on line 32

Strict Standards: Non-static method JLoader::register() should not be called statically in C:\xampp\htdocs\osu\libraries\loader.php on line 71

Strict Standards: Non-static method JLoader::load() should not be called statically in C:\xampp\htdocs\osu\libraries\loader.php on line 161

Strict Standards: Non-static method JLoader::register() should not be called statically in C:\xampp\htdocs\osu\libraries\loader.php on line 138

Strict Standards: Non-static method JRequest::clean() should not be called statically in C:\xampp\htdocs\osu\libraries\joomla\import.php on line 33

Strict Standards: Non-static method JRequest::_cleanArray() should not be called statically in C:\xampp\htdocs\osu\libraries\joomla\environment\request.php on line 463

Strict Standards: Non-static method JRequest::_cleanArray() should not be called statically in C:\xampp\htdocs\osu\libraries\joomla\environment\request.php on line 464

Strict Standards: Non-static method JRequest::_cleanArray() should not be called statically in C:\xampp\htdocs\osu\libraries\joomla\environment\request.php on line 465

Strict Standards: Non-static method JRequest::_cleanArray() should not be called statically in C:\xampp\htdocs\osu\libraries\joomla\environment\request.php on line 466

Strict Standards: Non-static method JRequest::_cleanArray() should not be called statically in C:\xampp\htdocs\osu\libraries\joomla\environment\request.php on line 467

Strict Standards: Non-static method JRequest::_cleanArray() should not be called statically in C:\xampp\htdocs\osu\libraries\joomla\environment\request.php on line 468

Warning: Cannot modify header information - headers already sent by (output started at C:\xampp\htdocs\osu\libraries\joomla\import.php:46) in C:\xampp\htdocs\osu\libraries\joomla\factory.php on line 566 Database Error: Unable to connect to the database:Could not connect to database

Please what was my error. Is there a special way to have backed up database. I am now running xampp 1.8.1 on windows 7. Upgraded from xampp 1.7.0

Community
  • 1
  • 1
user1801410
  • 39
  • 1
  • 2
  • 5

4 Answers4

0

How to fix strict standards error: http://vuthakh.blogspot.gr/2012/07/how-to-fix-joomla-error-strict.html

For the "Unable to connect to database error" check your configuration file to see if db name, password etc are correct

Kostis
  • 953
  • 9
  • 21
  • Thanks for your reply and which of the configuration file do i check. Hope I have not lost all my sites? – user1801410 Nov 08 '12 at 23:05
  • Done as required by the blog but still the same error. I also checked the configuration file of my joomla site but the database name isn't in myphpadmin databases. Only default databases are there, All my sites databases ain't there. I have about 25 sites which I can't find and associated databases. – user1801410 Nov 08 '12 at 23:44
  • Didn't you get a backup of the database? – Kostis Nov 10 '12 at 11:28
  • I thought by not uninstalling the htdocs folder and mysql folder during uninstalling xampp 1.7 and installing xampp 1.8.1 on it would not affect my sites in anyway. Is that called a backup? – user1801410 Nov 11 '12 at 05:39
  • http://stackoverflow.com/questions/484750/restoring-mysql-database-from-physical-files see this..maybe it helps! Generally when you want to take a backup you will export your databases through phpmyadmin. – Kostis Nov 11 '12 at 16:51
  • thanks for your support so far, I have being able to clear the joomla strict standard issue. I did as told from the blog but didn't work initially because I was editing the wrong line in php.ini file until I came across line 535 & 552 where am supposed to have edited. Turn error display off. And it worked. – user1801410 Nov 12 '12 at 22:47
  • Right now, am battling with how to restore the Ibdata01 file by following the steps from the posted link above by Kostis. But unfortunately I don't have the .frm file or maybe I don't understand what and where to find it. Wish me well! – user1801410 Nov 12 '12 at 22:50
0

This error can be fix by entering the correct values in the configuration.php which contains in your Joomla root directory.

File looks like this below.

Config

Database connection error (3): Could not connect to database

Problem: This error message usually means that you are connecting to the wrong database server. For most Joomla installations, the joomla files themselves and the database it connects to are on the same server. When this is the case, "localhost" should be used the database server. We recreated this error message by setting the database host to "localhosttt" (localhost spelled wrong).

Solution: If your Joomla site is setup like most, check your configuration.php file and ensure your database host is set to "localhost". This is setting looks like the following in your config file:

public $host = 'localhost';

Database connection error (2): Could not connect to MySQL.

Problem: This error message generally means that your Joomla's configuration.php file has either the wrong database name or database username. In our testing environment, we changed both the database username and password, and in each separate occasion the same error message occurred.

Solution: You should review your configuration.php file and ensure you are using the correct MySQL username and password. These settings will appear in the file as:

public $user = 'userna5_dbuser'; public $password = 'dbpass';

If you are sure the settings are correct, it is recommend to reset your database user's password and update your configuration.php file with the new password. This will help ensure that you have the correct database password set.

Only if you still get Strict Standards: Non-static method JLoader::import(), to fix Strict Standards: Non-static method JLoader::import(),

change the following line in the php.ini file:

Line 516: error_reporting = E_ALL | E_STRICT

TO

Line 516: error_reporting = E_ALL & ~E_NOTICE & ~E_DEPRECATED

Save that and restart Apache and you should be good to go with installing and working with Joomla! on XAMPP

Techie
  • 44,706
  • 42
  • 157
  • 243
  • Thanks, this is very useful, I discovered that i can't find the site's database in myphpadmin though it is linking to the database: – user1801410 Nov 09 '12 at 00:55
0

Joomla gave me Database connection error (3): Could not connect to database error when I accidently forgot to turn off PHP safe mode. Hopefully saves someone trouble.

humHann
  • 118
  • 1
  • 2
  • 7
0

The error Database connection error (3): Could not connect to database can also occur if the database user does not have permissions granted for the database. If you are using cPanel:

  1. Select MySQL Databases.
  2. Scroll down to Add User To Database at the bottom on the page.
  3. Select the user for which you wish to check permissions.
  4. Select the database for which you wish to check the users permissions.
  5. Make sure at least the following permissions are checked:

    • INSERT
    • SELECT
    • UPDATE
    • DELETE

      For installing components the following permissions will also be needed:

    • CREATE
    • ALTER
    • DROP
  6. Click the Make Changes button
user2118400
  • 466
  • 1
  • 4
  • 5