Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

pre-installation question: PHP Warning: mysqli_connect(): (HY000/1045): Access denied


henryli

Recommended Posts

Dear Members,

I've just installed PHP5.4.43, and MySQL 5.0.10, on Windows Server with IIS6. I am trying to install OsCommerce 2.3.4, but haven't reached the configuration welcome page, with the following error when I try to browse the index.php in the catalog folder:

 

PHP Warning: mysqli_connect(): (HY000/1045): Access denied for user ''@'localhost' (using password: NO) in:

E: \xxx\catalog\includes\functions\database.php on line 20

 

I go to HTML editor to open the database.php file, and got to know line 20 is:

 $$link = mysqli_connect($server, $username, $password, $database);

 

Have I missed some settings to connect PHP with MySQL database? I've done the procedures listed on these two pre-installation pages

Requirement:

http://library.oscommerce.com/Online&en&oscom_2_3&getting_started&requirements

Pre-installation:

http://library.oscommerce.com/Online&en&oscom_2_3&getting_started&pre_installation

 

I've done the change of two files of configure.php to allow everyone access.

 

How do I connect MySQL database with PHP?

(I've removed semicolon of extensions=php_mysql.dll)

 

thanks indeed for your help!

 

Sincerely,

Henry

Link to comment
Share on other sites

Dear Members,

I create a new default.php file in the root folder like this, and it works, so it seems my PHP can connect to MySQL server:

 

<?php

$hd = mysql_connect ("localhost", "user1", "password");

mysql_select_db ("database1", $hd);

mysql_close($hd);

?>

 

It works fine without error. (if I change the password it generates access denied error).

Then why would my OsCommerce database.php file have mysqli_connect error as said above?

 

Thanks for your comments.

Henry

Link to comment
Share on other sites

I go to database.php and changed the line 20

$$link = mysqli_connect($server, $username, $password, $database);

to four real names of my server, username, password, and database name,

then finally the OsCommerce Welcome page display!!

 

but I don't know if this would incur security risk as I put the real password into the catalog\includes\functions\database.php file.

 

Henry

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...