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 (76.36 KiB) Viewed 2561 times
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
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
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;
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
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
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.
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
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
- Mel
http://online.enterpriseconsulting.com.au
Site with OpenCart extensions & code downloads, many new extensions coming soon!
Follow us on twitter for more updates
Users browsing this forum: No registered users and 5 guests