I have this query :
SELECT some_15_fields,
(SELECT GROUP_CONCAT(tb_inv_private_ip SEPARATOR ', ') FROM `network_interface`
WHERE network_interface.tb_inv_id=id) as 'private_ip',
(SELECT GROUP_CONCAT(server_inv_public_ip.tb_public_ip_address SEPARATOR ', ')
FROM server_inv_public_ip JOIN network_interface on server_inv_public_ip_id=network_interface.tb_inv_public_ip_id
WHERE network_interface.tb_inv_id=id) AS 'public_ip'
FROM inventory
LEFT JOIN portal_credential ON inventory.portal_tbl_id = portal_credential.id
LEFT JOIN customer_customer ON inventory.customer_tbl_id = customer_customer.id
WHERE
server_inventory.customer_tbl_id = '{cust_id}' AND inventory.active_flag in {state}
LIMIT 0, 1000;
My Django app on my server which has MySQL 8 too is returning
Error Code: 2013. Lost connection to MySQL server during query
I had to change LIMIT 0, 1000
to LIMIT 0, 500
for it to return the results;
How can I fix this ?
(Using raw query in Django and not using ORM here)