mysql_healthly

cat mysql_healthly.php
<?php
if (!defined(‘IN_PDK‘)){
    define(‘IN_PDK‘, true);
}
$db_name = $_GET[‘db_name‘];
$configs = include_once("include/config/db.ini.php");
echo "<pre>";
foreach($configs as $c){
    if($c[‘master‘][‘dbname‘] != $db_name && $db_name)     continue;
    $mysql_server_name=$c[‘master‘][‘host‘]; //改成自己的mysql数据库服务器
    $mysql_username=$c[‘master‘][‘username‘]; //改成自己的mysql数据库用户名
    $mysql_password=$c[‘master‘][‘password‘]; //改成自己的mysql数据库密码
    $mysql_database=$c[‘master‘][‘dbname‘]; //改成自己的mysql数据库名
    $conn=mysql_connect($mysql_server_name,$mysql_username,$mysql_password) ; //连接数据库
    if($conn){
        echo $c[‘master‘][‘host‘].$c[‘master‘][‘username‘].$c[‘master‘][‘dbname‘].‘ ok‘."<br>";
    }else{
        echo $c[‘master‘][‘host‘].$c[‘master‘][‘username‘].$c[‘master‘][‘dbname‘].‘ error‘."<br>";
    }
}
时间: 2024-11-10 07:06:23

mysql_healthly的相关文章