Board logo

標題: 如何變更CCMAIL的MSQL之root密碼 [打印本頁]

作者: service.support    時間: 2006-11-17 02:08     標題: 如何變更CCMAIL的MSQL之root密碼

1. 變更root for Mysql密碼為1234
[root@db MySQL-4.1.16]#mysql
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 2871130 to server version: 4.1.16-standard

Type 'help;' or '\h' for help. Type '\c' to clear the buffer.

mysql> SET PASSWORD FOR 'root'@'localhost' = PASSWORD('1234');

2.變更CCMAIL相關的設定檔
a. 當CCMAIL主機為純AP主機的話, 並不需要變更任何設定, 因為AP主機在讀寫DB的資料庫時, 本來就是用一個獨立的SQL帳號在讀寫, 所以並不是使用root帳號, 因此修改Mysql的root密碼時, 並不需要去變動AP主機的設定!!
b. 當CCMAIL主機為DB主機或獨自為AP兼DB主機的話, 僅需要修正/www/apache/htdocs/EIP/users/db_def.inc, /etc/pam.d/localuser,/etc/pam.d/smtp三個檔案中root的密碼欄位設定即可!!
[root@db root]#vi /www/apache/htdocs/EIP/users/db_def.inc
<?
        /************************
        * Define User's Tables  *
        ************************/
global $DB_USERINFO;
global $DB_IO;
global $DB_HOST,$DB_UESR,$DB_PASSWD;
global $MDB_HOST,$MDB_USER,$MDB_PASSWD;
global $SDB_HOST,$SDB_USER,$SDB_PASSWD;
global $DB_DSHOST,$DB_DSUSER,$DB_DSPASSWD;
        //Define database information(host, user, passwd)
        $DB_TYPE = "mysql";
        $DB_LANG = "big5";
        $DB_HOST = "localhost";
        $DB_USER = "root";
        $DB_PASSWD = "1234";

        $DB_MHOST = "localhost";
        $DB_MUSER = "root";
        $DB_MPASSWD = "1234";

        $MDB_HOST = "localhost";
        $MDB_USER = "root";
        $MDB_PASSWD = "1234";

        $SDB_HOST = "localhost";
        $SDB_USER = "root";
        $SDB_PASSWD = "1234";

        $POP_USER = "pop3user";
        $POP_PASSWD = "pop3pass";

        if (!mysql_pconnect($DB_HOST,$DB_USER,$DB_PASSWD))
                {
                $DB_HOST=$SDB_HOST;
                $DB_USER=$SDB_USER;
                $DB_PASSWD=$SDB_PASSWD;
                $failover=1;
                }

        $DB_SHOST[0] = "localhost";
        $DB_SUSER[0] = "root";
        $DB_SPASSWD[0] = "1234";
        $DB_SWEIGHT[0] = "1";

        $DB_DSHOST = "localhost";
        $DB_DSUSER = "root";
        $DB_DSPASSWD = "1234";

        $DB_HA_MONLINE = "1";
        $DB_HA_SONLINE = "1";
        $DB_HA_SHOSTS = "1";
        $DB_HA_MODE = "1";


[root@db root]#vi /etc/pam.d/localuser
#%PAM-1.0
auth       sufficient   /lib/security/pam_mysql.so user=root passwd=1234 host=localhost db=webmailnew table=webmailnew.MailAccount usercolumn=AccountName passwdcolumn=password crypt=3
auth       sufficient   /lib/security/pam_mysql.so user=root passwd=1234 host=localhost db=webmailnew table=webmailnew.MailAccount usercolumn=REPLACE(AccountName,'@','_') passwdcolumn=password crypt=3
auth       sufficient   /lib/security/pam_mysql.so user=root passwd=1234 host=localhost db=EIP table=EIP.emp_account usercolumn=login_name passwdcolumn=password crypt=2
account    sufficient   /lib/security/pam_mysql.so user=root passwd=1234 host=localhost db=webmailnew table=webmailnew.MailAccount usercolumn=AccountName passwdcolumn=password crypt=3
account    sufficient   /lib/security/pam_mysql.so user=root passwd=1234 host=localhost db=webmailnew table=webmailnew.MailAccount usercolumn=REPLACE(AccountName,'@','_') passwdcolumn=password crypt=3
account    sufficient   /lib/security/pam_mysql.so user=root passwd=1234 host=localhost db=EIP table=EIP.emp_account usercolumn=login_name passwdcolumn=password crypt=2
~

[root@db root]#vi /etc/pam.d/smtp
#%PAM-1.0
auth       required     /lib/security/pam_mysql.so user=root passwd=1234 host=localhost db=EIP table=EIP.emp_account usercolumn=login_name passwdcolumn=password where=!INSTR(concat(':',IF(ISNULL(usable_subapid),'',usable_subapid),':'),':573:') crypt=2
account    required     /lib/security/pam_mysql.so user=root passwd=1234 host=localhost db=EIP table=EIP.emp_account usercolumn=login_name passwdcolumn=password where=!INSTR(concat(':',IF(ISNULL(usable_subapid),'',usable_subapid),':'),':573:') crypt=2




歡迎光臨 HGIGA Service Docs (http://docs.hgiga.com/Discuz4/) Powered by Discuz! 4.1.0