我为此查询:
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
长时间运行查询后,它最终抛出了该错误:
Error
SQL query: DocumentationEdit Edit
SELECT `CHARACTER_SET_NAME` AS `Charset`, `DESCRIPTION` AS `Description` FROM `information_schema`.`CHARACTER_SETS`
Open new phpMyAdmin window
mysqli_connect(): (08004/1040): Too many connections
mysqli_real_connect(): (28000/1045): Access denied for user 'ptrcao'@'localhost' (using password: NO)
mysqli_real_connect(): (28000/1045): Access denied for user 'ptrcao'@'localhost' (using password: NO)
Notice in ./libraries/classes/Config.php#855
Undefined index: collation_connection
Backtrace
./libraries/classes/Config.php#968: PhpMyAdmin\Config->_setConnectionCollation()
./libraries/common.inc.php#453: PhpMyAdmin\Config->loadUserPreferences()
./index.php#26: require_once(./libraries/common.inc.php)
Notice in ./libraries/classes/DatabaseInterface.php#1501
Undefined index: charset_connection
Backtrace
./libraries/classes/Config.php#857: PhpMyAdmin\DatabaseInterface->setCollation(string 'utf8mb4_unicode_ci')
./libraries/classes/Config.php#968: PhpMyAdmin\Config->_setConnectionCollation()
./libraries/common.inc.php#453: PhpMyAdmin\Config->loadUserPreferences()
./index.php#26: require_once(./libraries/common.inc.php)
Failed to set configured collation connection!
Notice in ./index.php#264
Undefined variable: collation_connection
Backtrace
Previously,我在查询时遇到了问题,无法充分利用我的内存资源。然后,我添加了16G的交换内存作为权宜之计。它似乎避免了先前遇到的#2013 - Lost connection to MySQL server during query
错误,但是经过长时间运行后,查询却产生了上述所有错误。请告知。
/usr/local/cpanel/base/3rdparty/phpMyAdmin/libraries/classes/DatabaseInterface.php:
<?php
/* vim: set expandtab sw=4 ts=4 sts=4: */
/**
* Main interface for database interactions
*
* @package PhpMyAdmin-DBI
*/
namespace PhpMyAdmin;
use PhpMyAdmin\Core;
use PhpMyAdmin\Database\DatabaseList;
use PhpMyAdmin\Dbi\DbiExtension;
use PhpMyAdmin\Dbi\DbiDummy;
use PhpMyAdmin\Dbi\DbiMysql;
use PhpMyAdmin\Dbi\DbiMysqli;
use PhpMyAdmin\Di\Container;
use PhpMyAdmin\Error;
use PhpMyAdmin\Index;
use PhpMyAdmin\LanguageManager;
use PhpMyAdmin\Relation;
use PhpMyAdmin\SystemDatabase;
use PhpMyAdmin\Table;
use PhpMyAdmin\Types;
"DatabaseInterface.php" 3060L, 104788C
/usr/local/cpanel/base/3rdparty/phpMyAdmin/libraries/classes/Config.php:
<?php
/* vim: set expandtab sw=4 ts=4 sts=4: */
/**
* Configuration handling.
*
* @package PhpMyAdmin
*/
namespace PhpMyAdmin;
use DirectoryIterator;
use PhpMyAdmin\Core;
use PhpMyAdmin\Error;
use PhpMyAdmin\LanguageManager;
use PhpMyAdmin\ThemeManager;
use PhpMyAdmin\Url;
use PhpMyAdmin\UserPreferences;
use PhpMyAdmin\Util;
use PhpMyAdmin\Utils\HttpRequest;
/**
* Indication for error handler (see end of this file).
*/
$GLOBALS['pma_config_loading'] = false;
/**
* Configuration class
*
* @package PhpMyAdmin
*/
class Config
{
/**
* @var string default config source
*/
var $default_source = './libraries/config.default.php';
/**
* @var array default configuration settings
*/
var $default = array();
/**
* @var array configuration settings, without user preferences applied
*/
var $base_settings = array();
/**
* @var array configuration settings
*/
var $settings = array();
/**
* @var string config source
*/
var $source = '';
/**
* @var int source modification time
*/
var $source_mtime = 0;
var $default_source_mtime = 0;
"Config.php" 1800L, 57604C
/usr/local/cpanel/base/3rdparty/phpMyAdmin/index.php:
<?php
/* vim: set expandtab sw=4 ts=4 sts=4: */
/**
* Main loader script
*
* @package PhpMyAdmin
*/
use PhpMyAdmin\Charsets;
use PhpMyAdmin\Config;
use PhpMyAdmin\Core;
use PhpMyAdmin\Display\GitRevision;
use PhpMyAdmin\LanguageManager;
use PhpMyAdmin\Message;
use PhpMyAdmin\RecentFavoriteTable;
use PhpMyAdmin\Relation;
use PhpMyAdmin\Response;
use PhpMyAdmin\Sanitize;
use PhpMyAdmin\Server\Select;
use PhpMyAdmin\ThemeManager;
use PhpMyAdmin\Url;
use PhpMyAdmin\Util;
/**
* Gets some core libraries and displays a top message if required
*/
require_once 'libraries/common.inc.php';
/**
* pass variables to child pages
*/
$drops = array(
'lang',
'server',
'collation_connection',
'db',
'table'
);
foreach ($drops as $each_drop) {
if (array_key_exists($each_drop, $_GET)) {
unset($_GET[$each_drop]);
}
}
unset($drops, $each_drop);
/*
* Black list of all scripts to which front-end must submit data.
* Such scripts must not be loaded on home page.
*
*/
$target_blacklist = array (
'import.php', 'export.php'
);
// If we have a valid target, let's load that script instead
if (! empty($_REQUEST['target'])
&& is_string($_REQUEST['target'])
&& ! preg_match('/^index/', $_REQUEST['target'])
&& ! in_array($_REQUEST['target'], $target_blacklist)
&& Core::checkPageValidity($_REQUEST['target'], [], true)
) {
include $_REQUEST['target'];
"index.php" 680L, 19899C