PHPMyAdmin #2013 - Lost connection to MySQL server during query

心已入冬 提交于 2019-12-13 04:18:04

问题


Specifically within the context of PHPMyAdmin, I haven't been able to find any workable answers.

I get this error

MySQL said: Documentation

2013 - Lost connection to MySQL server during query

After running the following query:

-- Deleting all duplicate products in wp_posts table 
DELETE FROM wp_posts 
WHERE post_type = 'Product' AND id NOT IN (SELECT x.minid FROM (SELECT p.post_title, MIN(p.ID) as minid, m.meta_value
FROM 
    wp_postmeta m
    INNER JOIN wp_posts p 
        ON  p.id = m.post_id
        AND p.post_type = 'Product' 
WHERE 
    m.meta_key = '_regular_price'
    AND NOT EXISTS (
        SELECT 1
        FROM 
            wp_postmeta m1
            INNER JOIN wp_posts p1
                ON  p1.id = m1.post_id
                AND p1.post_type = 'Product'
        WHERE 
            m1.meta_key = '_regular_price'
            AND p1.post_title = p.post_title
            AND m1.meta_value < m.meta_value
     )
 GROUP BY p.post_title, m.meta_value) x
 );


 -- Deleting all corresponding wp_postmeta.post_ids that don't have a match in wp_posts.id after the duplicate deletion above
DELETE pm 
FROM   wp_postmeta pm 
WHERE  post_id IN (SELECT post_id 
                   FROM  (SELECT post_id 
                          FROM   wp_postmeta pm 
                                 LEFT JOIN wp_posts p 
                                        ON p.id = pm.post_id 
                          WHERE  p.id IS NULL 
                                 AND p.post_type = "product") i);

Is there a setting within PHPMyAdmin that I can change to make this error go away? I never got this before and I've run some pretty large queries.

来源:https://stackoverflow.com/questions/54585491/phpmyadmin-2013-lost-connection-to-mysql-server-during-query

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!