Post by pius4real » Fri Oct 01, 2010 3:04 am

i transfer the the script to another computer to view the my shop on xampp localhost all the images and the links appeared but if i want to buy once i click on the links i got this message :
Warning: mysql_connect() [function.mysql-connect]: Access denied for user 'opencart'@'localhost' (using password: YES) in C:\xampp\htdocs\system\database\mysql.php on line 6
Error: Could not make a database connection using opencart@localhost
Warning: mysql_close() expects parameter 1 to be resource, boolean given in C:\xampp\htdocs\system\database\mysql.php on line 66
please i need help as soon as possible.

Newbie

Posts

Joined
Fri Oct 01, 2010 1:14 am

Post by pius4real » Fri Oct 01, 2010 3:34 am

i transfer the the script to another computer to view the my shop on xampp localhost all the images and the links appeared but if i want to buy once i click on the links i got this message :
Warning: mysql_connect() [function.mysql-connect]: Access denied for user 'opencart'@'localhost' (using password: YES) in C:\xampp\htdocs\system\database\mysql.php on line 6
Error: Could not make a database connection using opencart@localhost
Warning: mysql_close() expects parameter 1 to be resource, boolean given in C:\xampp\htdocs\system\database\mysql.php on line 66
please i need help as soon as possible.

Newbie

Posts

Joined
Fri Oct 01, 2010 1:14 am

Post by Daniel » Sun Oct 03, 2010 7:39 am

you need to uypdate your config file if you have moved your site.

you can not type localhost if the site is not on the computer you are using.

OpenCart®
Project Owner & Developer.


User avatar
Administrator

Posts

Joined
Fri Nov 03, 2006 6:57 pm

Post by pius4real » Sun Oct 17, 2010 11:42 am

i have try to update the config file its say the name (pharmacy folder cannot be found , let me paste the config file here so u can write how it surpose to look like when am moving it to another computer, becos am still new in programming.the folder name is (pharmacy ) this is the config file below :

<?php
// DIR
define('DIR_APPLICATION', 'C:\xampp\htdocs/catalog/');
define('DIR_SYSTEM', 'C:\xampp\htdocs/system/');
define('DIR_DATABASE', 'C:\xampp\htdocs/system/database/');
define('DIR_LANGUAGE', 'C:\xampp\htdocs/catalog/language/');
define('DIR_TEMPLATE', 'C:\xampp\htdocs/catalog/view/theme/');
define('DIR_CONFIG', 'C:\xampp\htdocs/system/config/');
define('DIR_IMAGE', 'C:\xampp\htdocs/image/');
define('DIR_CACHE', 'C:\xampp\htdocs/system/cache/');
define('DIR_DOWNLOAD', 'C:\xampp\htdocs/download/');
define('DIR_LOGS', 'C:\xampp\htdocs/system/logs/');

// DB
define('DB_DRIVER', 'mysql');
define('DB_HOSTNAME', 'localhost');
define('DB_USERNAME', 'opencart');
define('DB_PASSWORD', '****');
define('DB_DATABASE', '****');
define('DB_PREFIX', '');
?>

Admin config file below :
<?php
// HTTP
define('HTTP_SERVER', 'http://localhost/admin/');
define('HTTP_CATALOG', 'http://localhost/');
define('HTTP_IMAGE', 'http://localhost/image/');

// HTTPS
define('HTTPS_SERVER', 'http://localhost/admin/');
define('HTTPS_IMAGE', 'http://localhost/image/');

// DIR
define('DIR_APPLICATION', 'C:\xampp\htdocs/admin/');
define('DIR_SYSTEM', 'C:\xampp\htdocs/system/');
define('DIR_DATABASE', 'C:\xampp\htdocs/system/database/');
define('DIR_LANGUAGE', 'C:\xampp\htdocs/admin/language/');
define('DIR_TEMPLATE', 'C:\xampp\htdocs/admin/view/template/');
define('DIR_CONFIG', 'C:\xampp\htdocs/system/config/');
define('DIR_IMAGE', 'C:\xampp\htdocs/image/');
define('DIR_CACHE', 'C:\xampp\htdocs/system/cache/');
define('DIR_DOWNLOAD', 'C:\xampp\htdocs/download/');
define('DIR_LOGS', 'C:\xampp\htdocs/system/logs/');
define('DIR_CATALOG', 'C:\xampp\htdocs/catalog/');

// DB
define('DB_DRIVER', 'mysql');
define('DB_HOSTNAME', 'localhost');
define('DB_USERNAME', 'opencart');
define('DB_PASSWORD', '***');
define('DB_DATABASE', '***');
define('DB_PREFIX', '');
?>
Last edited by i2Paq on Wed Feb 09, 2011 12:41 am, edited 1 time in total.
Reason: Removed usrname & psswrd

Newbie

Posts

Joined
Fri Oct 01, 2010 1:14 am

Post by ub13 » Tue Feb 08, 2011 9:29 pm

I'm guessing this thread has been solved, but for completeness, there are 2 config.php files, one in the www-root/config.php and one under www-root/admin/config.php

Both should contain a valid username and password for the database.

Newbie

Posts

Joined
Tue Feb 08, 2011 9:22 pm

Post by gejenk » Thu Dec 31, 2015 1:12 pm

dear all,
in this error case "opencart access denied for user @'localhost' (using password yes)" even we have entered others users with password included but still generate error

plis try my own try ..:D

fill the username full means hosting name included as shown in phpMyadmin user name, so the syntax will be like:
1. hostname_username
2. hostname_database

hope this "try" is useful to all

tks

Newbie

Posts

Joined
Thu Dec 31, 2015 1:07 pm
Who is online

Users browsing this forum: No registered users and 5 guests