本站即日起正式部署SSL证书启用https安全连接, 联系站长:416326801#qq.com(#改成@)

Latest from the blog

Cacti配置远程MySQL

标签: MySQL Cacti

一共需要修改三处:

其中两处比较好找,分别在/var/www/html/include/config.php/var/www/html/include/global.php

/* make sure these values refect your actual database/host/user/password */
$database_type = "mysql";
$database_default = "cacti";
$database_hostname = "mysql.cacti";
$database_username = "cactiuser";
$database_password = "cactiuser";
$database_port = "3306";

最后一处在/etc/spine.conf,Cacti有数据但是图像一直空白也有可能是这个原因造成的!

DB_Host         mysql.cacti
DB_Database     cacti
DB_User         cactiuser
DB_Pass         cactiuser
DB_Port         3306
DB_PreG         0

Cacti修改MySQL数据库默认字符集

标签: MySQL Cacti

找到/var/www/html/lib/adodb/drivers/adodb-mysql.inc.php

在mysql_select_db之后增加"set names utf8"

function SelectDB($dbName) {
    $this->databaseName = $dbName;
    if( $this->_connectionID ) {
        $select = @mysql_select_db($dbName, $this->_connectionID);
        if( $select ) {
            return mysql_query("set names utf8");
        }
        return false;
    } else
        return false;
}