歡迎您光臨本站 註冊首頁

redhad 4 cacti安裝問題求救!!!

←手機掃碼閱讀     火星人 @ 2014-03-04 , reply:0

redhad 4 cacti安裝問題求救!!!

我想大家裝cacti的時候有遇到過如下報錯的問題吧?

今天裝好了,IE訪問時就出現這個提示,其他什麼都沒有了,網上找了很多資料,都沒搞定,有網友提示說要改/etc/my.cof里的東西(解決辦法把/etc/my.cof中mysql.sock位置改成/var/lib/mysql(or /var/lib ?)即可),但是我的/etc目錄下並沒有這個文件(估計是系統版本問題)
FATAL: Cannot connect to MySQL server on 'localhost'. Please make sure you have specified a valid MySQL database name in 'include/config.php'

我是在 redhat 4 上裝的,密碼保證是正確,附上部分信息
以下是config.php里的
/* make sure these values refect your actual database/host/user/password */
$database_type = "mysql";
$database_default = "cactidb";
$database_hostname = "localhost";
$database_username = "cactiuser";
$database_password = "cactipw";
$database_port = "3306";

/* Default session name - Session name must contain alpha characters */
#$cacti_session_name = "Cacti";

?>


以下是授權
mysql> create database cactidb;
  mysql> grant all on cactidb.* to root;
  mysql> grant all on cactidb.* to root@localhost;
  mysql> grant all on cactidb.* to cactiuser;
  mysql> grant all on cactidb.* to cactiuser@localhost;
  mysql> grant all on cactidb.* to cactiuser@localhost identified by 'cactipw';
而且我的mysql.sock 在mysql目錄下,而非/tmp目錄下
# cd /var/lib/mysql/
# ls
cactidb  cacti.err  cacti.pid  ibdata1  ib_logfile0  ib_logfile1  localhost.localdomain.err  mysql  mysql.sock  test
# pwd
/var/lib/mysql

mysql,httpd,snmpd都是運行正常的

請各位高手幫個忙指點,謝謝!斑竹出招吧,幫忙。
《解決方案》

修改/etc/my.cnf
《解決方案》

回復 #1 atianyu 的帖子

添加rpm的源然後使用yum 進行安裝
《解決方案》

回復 #3 kns1024wh 的帖子

什麼意思?使用YUM進行安裝啥?
《解決方案》

回復 #2 chenyx 的帖子

/etc下也沒有my.cnf這個目錄
《解決方案》

回復 #5 atianyu 的帖子

mysql安裝過了?
《解決方案》

回復 #6 chenyx 的帖子

裝過了
# ./mysql status
MySQL running (1834)                                       [  OK  ]
#
# mysql -u root -p123456
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 442
Server version: 5.1.36 MySQL Community Server (GPL)

Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.

mysql>
《解決方案》

在mysql安裝目錄下找找my.cnf
《解決方案》

回復 #8 chenyx 的帖子

謝謝你的回答,可是那個文件還是沒有
# ls
cactidb  cacti.err  cacti.pid  ibdata1  ib_logfile0  ib_logfile1  localhost.localdomain.err  mysql  mysql.sock  test
# pwd
/var/lib/mysql
# cd mysql
# ls
columns_priv.frm  func.MYD           help_keyword.MYI   ndb_binlog_index.frm  procs_priv.MYD   tables_priv.MYI            time_zone_transition.frm
columns_priv.MYD  func.MYI           help_relation.frm  ndb_binlog_index.MYD  procs_priv.MYI   time_zone.frm              time_zone_transition.MYD
columns_priv.MYI  general_log.CSM    help_relation.MYD  ndb_binlog_index.MYI  servers.frm      time_zone_leap_second.frm  time_zone_transition.MYI
db.frm            general_log.CSV    help_relation.MYI  plugin.frm            servers.MYD      time_zone_leap_second.MYD  time_zone_transition_type.frm
db.MYD            general_log.frm    help_topic.frm     plugin.MYD            servers.MYI      time_zone_leap_second.MYI  time_zone_transition_type.MYD
db.MYI            help_category.frm  help_topic.MYD     plugin.MYI            slow_log.CSM     time_zone.MYD              time_zone_transition_type.MYI
event.frm         help_category.MYD  help_topic.MYI     proc.frm              slow_log.CSV     time_zone.MYI              user.frm
event.MYD         help_category.MYI  host.frm           proc.MYD              slow_log.frm     time_zone_name.frm         user.MYD
event.MYI         help_keyword.frm   host.MYD           proc.MYI              tables_priv.frm  time_zone_name.MYD         user.MYI
func.frm          help_keyword.MYD   host.MYI           procs_priv.frm        tables_priv.MYD  time_zone_name.MYI
# pwd
/var/lib/mysql/mysql
#
《解決方案》

你用的是什麼方式安裝的mysql?

[火星人 ] redhad 4 cacti安裝問題求救!!!已經有418次圍觀

http://coctec.com/docs/service/show-post-20880.html