Post by distante » Sun Jun 15, 2014 3:15 am

Hello,

I bougth the "Kids Planet" here: http://themeforest.net/item/kids-planet ... all&page=2

and Installed all as said but I have a problem, whenever I change the template from default to kids I get a:

Code: Select all

Access denied for user 'root'@'localhost' (using password: NO)
The Theme developer says is a problem with my server, but really I don't know where to look since the default template works ok and all the info in config.php (both in the Root and root/admin) have the correct sql connection .


This is the OpenCart error log:

Code: Select all

2014-06-14 13:23:04 - PHP Warning:  mysql_query() [<a href='function.mysql-query'>function.mysql-query</a>]: Access denied for user 'root'@'localhost' (using password: NO) in /public_html/baul/catalog/view/theme/kids/template/module/slideshow.tpl on line 3
2014-06-14 13:23:04 - PHP Warning:  mysql_query() [<a href='function.mysql-query'>function.mysql-query</a>]: A link to the server could not be established in /public_html/baul/catalog/view/theme/kids/template/module/slideshow.tpl on line 3
and this is the first lines of the slideshow.tpl file

Code: Select all

?php
$sql = "SELECT * FROM " . DB_PREFIX . "theme_settings";
$rez = mysql_query($sql) or die(mysql_error());
while ($row = mysql_fetch_array($rez)) {
  $home_layout = $row['home_layout'];
}
Any ideas?

Regards

Newbie

Posts

Joined
Fri Jun 13, 2014 1:14 pm

Post by MarketInSG » Sun Jun 15, 2014 3:24 pm

your database username / password is incorrect. You are not using a password to log into your database? have a look at your config.php files


User avatar
Guru Member

Posts

Joined
Wed Nov 16, 2011 11:53 am
Location - Singapore

Post by distante » Sun Jun 15, 2014 10:52 pm

Hello MarketInSG, thanks for your reply,

Yes, I'm using a password.

This is in config.php and adming/config.php

Code: Select all

// DB
define('DB_DRIVER', 'mysqli');
define('DB_HOSTNAME', 'localhost');
define('DB_USERNAME', '***MyPassword***');
define('DB_PASSWORD', '***MyUserName***'');
define('DB_DATABASE', '***MyDataBase***'');
define('DB_PREFIX', 'oc_');
?>
As I said before my site work just fine with the default template, but then I change the template to Kids the message appears

Newbie

Posts

Joined
Fri Jun 13, 2014 1:14 pm

Post by artcore » Mon Jun 16, 2014 5:26 am

Try searching for root'@'localhost in your bought template and change accordingly. It seems there's some hard coded connection settings for the database. You can use agent ransack to search for text inside files.
Also sql queries inside a tpl is not the best usage of standards 8)

Attn: I no longer provide OpenCart extensions, nor future support - this includes forum posts.
Reason: OpenCart version 3+ ;D

Thanks!


User avatar
Active Member

Posts

Joined
Tue Jul 09, 2013 4:13 am
Location - The Netherlands

Post by rph » Mon Jun 16, 2014 5:53 am

I strongly advise you to NOT use the theme and seek a refund immediately. There are two major red flags:

1) The theme makes database queries. OpenCart uses an MVC design pattern which means they should never, ever, ever do this. Not ever. To make it worse it's not even using OpenCart's database connection method so something like an upgrade to PHP 5.5 would require a complete rewrite to the theme database queries.

2) The designer doesn't understand database connections. Your server is configured exactly right. The template is trying to make a connection without a password and the server is rejecting it. If they don't understand a security issue that fundamental what else don't they know?

-Ryan


rph
Expert Member

Posts

Joined
Fri Jan 08, 2010 5:05 am
Location - Lincoln, Nebraska

Post by distante » Mon Jun 16, 2014 6:44 am

Hello rph, thanks for your reply.

The support told my that my ticket will be forwarded to the programmer, I see the things you say and this is my face right now-> :choke:

This is my very first time using OpenCart as a e-commerce platform, so I'm kind of a n00b.

Let me ask, all the themes listed in the extensions link (http://www.opencart.com/index.php?route ... /extension) are official approved?

Thanks again!

Newbie

Posts

Joined
Fri Jun 13, 2014 1:14 pm

Post by rph » Mon Jun 16, 2014 7:41 am

There's no official approval process for the Extension Store so quality is going to vary quite a bit. I believe http://opencartx.com is more proactive on policing extensions so you'd likely find better overall quality there.

-Ryan


rph
Expert Member

Posts

Joined
Fri Jan 08, 2010 5:05 am
Location - Lincoln, Nebraska

Post by distante » Mon Jun 16, 2014 8:45 am

Thank you for your kind and helpful replies rph.

Newbie

Posts

Joined
Fri Jun 13, 2014 1:14 pm

Post by Ljohanne » Mon Oct 02, 2017 11:17 pm

Hi All,
I had the same issue. In my instalation, I noticed that the same error happened everytime when I tried to install opencart in different computers and versions.
I decided to create a new user with ALL privileges BEFORE to install the opencart (step No.3), then I capture the same user and password that I was created ....and it works !!!
Once you created the new user for you host (in my case was localhost:8080), press "continue" in the opencart step 3...... 5 seconds later on, opencart was installed.

Regards,
Lj

Newbie

Posts

Joined
Wed Sep 27, 2017 2:57 am
Who is online

Users browsing this forum: No registered users and 39 guests