Post by shamano » Fri Jun 27, 2014 4:46 am

Hello to all,
I have a problem on my opencart, I transferred the folder of the site and the entire database from one hosting service to another, I connected the database and everything works.
The problem is only one if I try to access admin products comes out this error: Notice: Error: Lost connection to MySQL server During query
Error No: 2013
SELECT * FROM product p LEFT JOIN product_description pd ON (p.product_id = pd.product_id) WHERE pd.language_id = '2 'GROUP BY p.product_id ORDER BY ASC LIMIT pd.name 0.15000 in / home/iw9gzs/public_html / system / database / mysql.php on line 50

I tried everything but the result is always the same, the opencart version is 1.5.6.4
would know someone help me?

Attachments

Immagine.jpg

Immagine.jpg (76.36 KiB) Viewed 2561 times


Newbie

Posts

Joined
Fri Jun 27, 2014 12:03 am

Post by melbagnato » Sun Jun 29, 2014 7:14 pm

Hi shamano,

you are performing a query that will return up to 15,000 rows. I'd dare to suggest that your mysql timeout on that new host is too low for such a query.

Also, if you have that many products, it might be worth investing in a few database indexes to speed things up. This will also help you with these queries that contain so many joins.

- Mel

http://online.enterpriseconsulting.com.au

Site with OpenCart extensions & code downloads, many new extensions coming soon!
Follow us on twitter for more updates

Image


User avatar
Active Member

Posts

Joined
Wed Jan 13, 2010 1:39 pm
Location - Melbourne

Post by shamano » Mon Jun 30, 2014 4:04 pm

Hello Melbagnato,
thanks for your answer, they are not very practical for mysql you explain better what should I do?

Newbie

Posts

Joined
Fri Jun 27, 2014 12:03 am

Post by melbagnato » Mon Jun 30, 2014 5:16 pm

Hi shamano,

Your standard query for that page only returns 20 records (ie the SQL says limit 0,20), but yours says limit 0,15000.

Your database is probably hosted on a server that timed out before it could return you all those records.

You should modify the "\admin\model\catalog\product.php" file to have the limit at 20 again (or modify the extension that is over-riding this value.

- Mel

http://online.enterpriseconsulting.com.au

Site with OpenCart extensions & code downloads, many new extensions coming soon!
Follow us on twitter for more updates

Image


User avatar
Active Member

Posts

Joined
Wed Jan 13, 2010 1:39 pm
Location - Melbourne

Post by shamano » Mon Jun 30, 2014 8:12 pm

Hello melbagnato,
thanks for your quick response, the value to change is this?

if (isset($data['start']) || isset($data['limit'])) {
if ($data['start'] < 0) {
$data['start'] = 0;
}

if ($data['limit'] < 1) {
$data['limit'] = 20;
}

$sql .= " LIMIT " . (int)$data['start'] . "," . (int)$data['limit'];
}

$query = $this->db->query($sql);

return $query->rows;

Newbie

Posts

Joined
Fri Jun 27, 2014 12:03 am

Post by Qphoria » Mon Jun 30, 2014 9:41 pm

I believe the limit you are reaching is set in the System->Settings under the Options Tab. You have entered 15000 there?
Don't edit code.

Image


User avatar
Administrator

Posts

Joined
Tue Jul 22, 2008 3:02 am

Post by shamano » Mon Jun 30, 2014 9:47 pm

Hello Qphoria,
you have entered the value and now I changed it to 10, the result is a blank page.
But I do not understand why the old hosting also works with 15000 new products and with the hosting does not work, what is wrong?

Newbie

Posts

Joined
Fri Jun 27, 2014 12:03 am

Post by shamano » Tue Jul 01, 2014 3:25 pm

Who can help me?

Newbie

Posts

Joined
Fri Jun 27, 2014 12:03 am

Post by melbagnato » Tue Jul 01, 2014 3:53 pm

Hi shamano,

PM me some details for your site and I'll take a look for you.

- Mel

http://online.enterpriseconsulting.com.au

Site with OpenCart extensions & code downloads, many new extensions coming soon!
Follow us on twitter for more updates

Image


User avatar
Active Member

Posts

Joined
Wed Jan 13, 2010 1:39 pm
Location - Melbourne

Post by shamano » Tue Jul 01, 2014 9:43 pm

melbagnato wrote:Hi shamano,

PM me some details for your site and I'll take a look for you.

- Mel

Hello,
you can not write in private.
can someone help me?

Newbie

Posts

Joined
Fri Jun 27, 2014 12:03 am

Post by melbagnato » Wed Jul 02, 2014 9:39 am

Hi shamano,

I have added a vqmod which removes the 'Order By' function of the getProducts() function in "/admin/model/catalog/product.php". You will see it in your "/vqmod/xml" directory, it's called "vqmod_Admin_Remove_Product_Order_By.xml"

For some reason, your database is having issues when this is included (I ran the queries directly on your databases and it failed each time). When I remove the Order By command it works.

This is a temporary fix, I will look further into your issue to find out what the problem could be.

- Mel

http://online.enterpriseconsulting.com.au

Site with OpenCart extensions & code downloads, many new extensions coming soon!
Follow us on twitter for more updates

Image


User avatar
Active Member

Posts

Joined
Wed Jan 13, 2010 1:39 pm
Location - Melbourne

Post by shamano » Wed Jul 02, 2014 2:59 pm

Hello Mel,
thank you for your support, I have to transfer my old site to the new domain, if you need anything they are at your disposal.
Sha

Newbie

Posts

Joined
Fri Jun 27, 2014 12:03 am

Post by Rainforest » Wed Jul 09, 2014 5:00 am

Hi melbagnato,

How do add database indexes. I am currently suffering from an admin lag and database timeouts. My host, hostgator, told me that I "may wish to add indexes to the database tables as they help to speed up queries and save processing time."

Thank you
melbagnato wrote:Hi shamano,

Your standard query for that page only returns 20 records (ie the SQL says limit 0,20), but yours says limit 0,15000.

Your database is probably hosted on a server that timed out before it could return you all those records.

You should modify the "\admin\model\catalog\product.php" file to have the limit at 20 again (or modify the extension that is over-riding this value.

- Mel

Self Taught Opencart User & Developer Since 2010.


User avatar
Active Member

Posts

Joined
Fri Jan 28, 2011 3:50 am

Post by victorj » Wed Jul 09, 2014 5:05 pm

use this, it will add indexes to database for you.

https://github.com/chrisatomix/opencart-turbo

Koeltechnische deurrubbers eenvoudig online op maat bestellen.
Alle niet stekplichtige onderdelen zoals scharnieren, sloten, randverwarming en verlichting voor alle typen koelingen en vriezers.
https://koelcel-onderdelen.com


User avatar
Expert Member

Posts

Joined
Sat Jun 25, 2011 4:09 am
Location - Alkmaar Holland

Post by melbagnato » Wed Jul 09, 2014 8:13 pm

Hi rainforest,

the turbo suggestion is a good one, but I personally like to manage my database indexing myself. Too often I see client's databases with multiple indexes on the same fields, or indexes on fields that are never used in joins or search processes.

Most of your speed benefits will come from database tweaks (and I'm including some SQL vqmods in that statement), but you really need to customise the changes to suit your site.

Feel free to have a go yourself, but if you get stuck PM me your details and I'll help you out.

- Mel

http://online.enterpriseconsulting.com.au

Site with OpenCart extensions & code downloads, many new extensions coming soon!
Follow us on twitter for more updates

Image


User avatar
Active Member

Posts

Joined
Wed Jan 13, 2010 1:39 pm
Location - Melbourne

Post by shamano » Fri Jul 11, 2014 5:14 pm

I can not go on this issue, Godaddy tells me that the problem is in my mysql, I do not know where to look ....

Newbie

Posts

Joined
Fri Jun 27, 2014 12:03 am


Post by melbagnato » Fri Jul 11, 2014 6:23 pm

Send me your server's details in a PM and I'll take a look for you.

- Mel

http://online.enterpriseconsulting.com.au

Site with OpenCart extensions & code downloads, many new extensions coming soon!
Follow us on twitter for more updates

Image


User avatar
Active Member

Posts

Joined
Wed Jan 13, 2010 1:39 pm
Location - Melbourne
Who is online

Users browsing this forum: No registered users and 5 guests