1

I have a table called products2 with about 830,000 rows in it. When I had about 500,000 rows, the query runs slow but fine. And now when I try to query something, it almost doesnt return anything in Mysql Workbench. Showing the following error:

>**strong text**Error Code: 2013. Lost connection to MySQL server during query  44.515 sec

I thought it has something to do with my Workbench connection to my database on Go-daddy host, but same thing happens even if I go straight to PHPadmin online tool. I have Product ID as primary key, unique index, not null and auto increment. The full table structure below:

  • ProductID int(11) AI PK
  • SupplierPartNum varchar(100)
  • OemPartNum varchar(100)
  • UPC varchar(45)
  • CostPrice decimal(10,2)
  • CompatibleWith text
  • ProductName varchar(500)
  • Brand varchar(45)
  • Manufacturer varchar(45)
  • Supplier int(11)
  • Category varchar(45)
  • SubCategory varchar(100)
  • Notes text
  • Notes2 varchar(500)
  • Quantity int(11)
  • PageYield varchar(45)
  • Condition varchar(45)
  • Color varchar(45)
  • Description varchar(21844)
  • IsTruckShip varchar(45)
  • UnitOfMeasure varchar(45)
  • MinQty int(11)
  • Width decimal(8,2)
  • Length decimal(8,2)
  • Height decimal(8,2)
  • Weight decimal(8,2)
  • Returnable varchar(5)
  • Warranty varchar(100)
  • SubCategory2 varchar(100)
  • ImageUrl1 varchar(150)

Queries failed (pretty much any query now fails):

select * from Products2 where Supplier = 15 and Description is not null and ImageUrl1 is not null and flag2 = 1;

select *from Products2 where Supplier = 10;

Did some research and increase the timeout. But doesn't help. I worked with Microsoft Sql before in Management studio and dealed with millions of rows before in mssql, it was fast and easy. I just dont get why doesn't it work in mysql, I am a newbie. I dont think this problem can be solve if my database is on localhost. The internet should be fast enough.

The server is sitting at godaddy's server as I have a hosting plan with them. I dont see any options on their website to set any configuration for the server.

Please help me. Thanks.

Corin
  • 2,317
  • 2
  • 32
  • 47
Zhen Cai
  • 11
  • 2
  • 3
  • possible duplicate of [Error Code: 2013. Lost connection to MySQL server during query](http://stackoverflow.com/questions/10563619/error-code-2013-lost-connection-to-mysql-server-during-query) – BK435 Mar 13 '15 at 18:12
  • I've looked at that post before and tried to set the Mysql session by setting: > Edit → Preferences → SQL Editor → DBMS connection read time out (in seconds): 6000. I am using Godaddy's hosting and all my database is there. I can't find how to set the max_allowed_packet and idk where to locate that my.ini file. Is it because the server is on Godaddy, hence I dont have any flexibility? I am new to mysql. Please help. Thanks. – Zhen Cai Mar 14 '15 at 22:07
  • If you are on windows your my.ini will be located in the default path (assuming you did not change where your data is stored) C:\ProgramData\MySQL\MySQL Server 5.6 , the file will be called `my`. – BK435 Mar 16 '15 at 17:39
  • http://stackoverflow.com/questions/29086366/lost-connection-to-mysql-during-query-mysql-workbench/29087889?noredirect=1#comment46409606_29087889 – BK435 Mar 16 '15 at 23:12

0 Answers0