本文整理匯總了PHP中PMA_Replication_Slave_control函數的典型用法代碼示例。如果您正苦於以下問題:PHP PMA_Replication_Slave_control函數的具體用法?PHP PMA_Replication_Slave_control怎麽用?PHP PMA_Replication_Slave_control使用的例子?那麽, 這裏精選的函數代碼示例或許可以為您提供幫助。
在下文中一共展示了PMA_Replication_Slave_control函數的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: PMA_Replication_Slave_changeMaster
/**
* Changes master for replication slave
*
* @param string $user replication user on master
* @param string $password password for the user
* @param string $host master's hostname or IP
* @param int $port port, where mysql is running
* @param array $pos position of mysql replication,
* array should contain fields File and Position
* @param bool $stop shall we stop slave?
* @param bool $start shall we start slave?
* @param mixed $link mysql link
*
* @return string output of CHANGE MASTER mysql command
*/
function PMA_Replication_Slave_changeMaster($user, $password, $host, $port, $pos, $stop = true, $start = true, $link = null)
{
if ($stop) {
PMA_Replication_Slave_control("STOP", null, $link);
}
$out = $GLOBALS['dbi']->tryQuery('CHANGE MASTER TO ' . 'MASTER_HOST=\'' . $host . '\',' . 'MASTER_PORT=' . $port * 1 . ',' . 'MASTER_USER=\'' . $user . '\',' . 'MASTER_PASSWORD=\'' . $password . '\',' . 'MASTER_LOG_FILE=\'' . $pos["File"] . '\',' . 'MASTER_LOG_POS=' . $pos["Position"] . ';', $link);
if ($start) {
PMA_Replication_Slave_control("START", null, $link);
}
return $out;
}
示例2: PMA_handleRequestForSlaveSkipError
/**
* handle control requests for Slave Skip Error
*
* @return boolean
*/
function PMA_handleRequestForSlaveSkipError()
{
$count = 1;
if (isset($_REQUEST['sr_skip_errors_count'])) {
$count = $_REQUEST['sr_skip_errors_count'] * 1;
}
$qStop = PMA_Replication_Slave_control("STOP");
$qSkip = $GLOBALS['dbi']->tryQuery("SET GLOBAL SQL_SLAVE_SKIP_COUNTER = " . $count . ";");
$qStart = PMA_Replication_Slave_control("START");
$result = $qStop !== false && $qStop !== -1 && $qSkip !== false && $qSkip !== -1 && $qStart !== false && $qStart !== -1;
return $result;
}
示例3: PMA_handleRequestForSlaveSkipError
/**
* handle control requests for Slave Skip Error
*
* @return NULL
*/
function PMA_handleRequestForSlaveSkipError()
{
$count = 1;
if (isset($_REQUEST['sr_skip_errors_count'])) {
$count = $_REQUEST['sr_skip_errors_count'] * 1;
}
PMA_Replication_Slave_control("STOP");
$GLOBALS['dbi']->tryQuery("SET GLOBAL SQL_SLAVE_SKIP_COUNTER = " . $count . ";");
PMA_Replication_Slave_control("START");
}