MySQL 설정 확인을 하기 위햔 간단한 프로그램 (show variables / show status)
서로 다른 DBMS의 설정된 값을 확인하기 위한 프로그램을 하나 만들었습니다.
가져와서 차이점을 출력하여 줍니다.
MySQL 설정 확인을 하기 위햔 간단한 프로그램에서는 show variables 와 show status 의 결과의 차이점을 보여 줍니다.
if ( $MODE == 'get_data' )
{
$aRtn1 = get_val_array( 'variables', $oMysqli );
$aRtn2 = get_val_array( 'variables', $oMysqliR );
$aRtn = array_diff($aRtn1, $aRtn2);
// print_r($aRtn1);
print_r($aRtn);
$aRtn1 = get_val_array( 'status', $oMysqli );
$aRtn2 = get_val_array( 'status', $oMysqliR );
$aRtn = array_diff($aRtn1, $aRtn2);
// print_r($aRtn1);
print_r($aRtn);
}
function get_val_array( $type, $oDbcon )
{
$aRtn = array();
if ( $type == 'variables' ) {
$sqlSelect = "show variables;";
}
if ( $type == 'status' ) {
$sqlSelect = "show status;";
}
$oResult = mq($sqlSelect, 'result', $oDbcon);
while ($aRs=@mysqli_fetch_assoc($oResult))
{
extract($aRs); //print_r($aRs); exit;
if ( $type == 'variables' || $type == 'status' ) {
$aRtn[$Variable_name] = $Value;
}
}
return $aRtn;
}