cacti msyql 問題(解決)
cacti伺服器監控了三台伺服器。可每隔10分鐘 頁面就報如下錯誤:
FATAL: Cannot connect to MySQL server on 'localhost'. Please make sure you have specified a valid MySQL database name in 'include/config.php'
各位給點意見如何修改mysql。
這是 config.php':
/* make sure these values refect your actual database/host/user/password */
$database_type = "mysql";
$database_default = "cacti";
$database_hostname = "localhost";
$database_username = "cacti";
$database_password = "cacti";
$database_port = "3306";
/* Default session name - Session name must contain alpha characters */
#$cacti_session_name = "Cacti";
# The following options will be passed to all MySQL clients
#password = your_password
port = 3306
socket = /var/lib/mysql/mysql.sock
# Here follows entries for some specific programs
# The MySQL server
port = 3306
socket = /var/lib/mysql/mysql.sock
skip-locking
key_buffer = 16M
max_allowed_packet = 1M
table_cache = 64
sort_buffer_size = 512K
net_buffer_length = 8K
read_buffer_size = 256K
read_rnd_buffer_size = 512K
myisam_sort_buffer_size = 8M
如果這裡配置不對的話 那肯定是連不上的,我現在的情況是能連上mysql 但是間隔 10分鐘會出現這樣的一次頁面錯誤提示。必須要等 1 分鐘左右的時間才能恢復過來。
[ 本帖最後由 liang3391 於 2009-5-6 15:50 編輯 ]
《解決方案》
看下mysql的日誌吧。
《解決方案》
root@testtt [~]# cat /var/log/mysqld.log.rpmsave
090417 17:42:46 mysqld started
090417 17:42:46 InnoDB: Started; log sequence number 0 43655
090417 17:42:46 Can't start server: Bind on TCP/IP port: Address already in use
090417 17:42:46 Do you already have another mysqld server running on port: 3306 ?
090417 17:42:46 Aborting
090417 17:42:46 InnoDB: Starting shutdown...
090417 17:42:48 InnoDB: Shutdown completed; log sequence number 0 43655
090417 17:42:48 /usr/libexec/mysqld: Shutdown complete
090417 17:42:48 mysqld ended
090417 17:52:11 mysqld started
090417 17:52:11 InnoDB: Started; log sequence number 0 43655
090417 17:52:11 Can't start server: Bind on TCP/IP port: Address already in use
090417 17:52:11 Do you already have another mysqld server running on port: 3306 ?
090417 17:52:11 Aborting
090417 17:52:11 InnoDB: Starting shutdown...
090417 17:52:13 InnoDB: Shutdown completed; log sequence number 0 43655
090417 17:52:13 /usr/libexec/mysqld: Shutdown complete
090417 17:52:13 mysqld ended
090417 17:54:42 mysqld started
090417 17:54:42 InnoDB: Started; log sequence number 0 43655
090417 17:54:42 Can't start server: Bind on TCP/IP port: Address already in use
090417 17:54:42 Do you already have another mysqld server running on port: 3306 ?
090417 17:54:42 Aborting
090417 17:54:42 InnoDB: Starting shutdown...
090417 17:54:44 InnoDB: Shutdown completed; log sequence number 0 43655
090417 17:54:44 /usr/libexec/mysqld: Shutdown complete
090417 17:54:44 mysqld ended
090417 21:26:17 mysqld started
090417 21:26:17 InnoDB: Started; log sequence number 0 43655
090417 21:26:18 /usr/libexec/mysqld: ready for connections.
Version: '5.0.45-log' socket: '/tmp/mysql.sock' port: 3306 Source distribution
090417 23:17:09 /usr/libexec/mysqld: Normal shutdown
《解決方案》
spine.conf的用戶名密碼配置對了么?
《解決方案》
回復 #4 david6102 的帖子
cacti沒有建立訪問mysql的用戶
如果建了,那樓主就用這個用戶在命令上連接一下試試
mysql -h localhost -u xxx -p xxx
[ 本帖最後由 00306 於 2009-5-5 17:21 編輯 ]
《解決方案》
上面MYSQL錯誤日誌明示說3306埠被佔用了,是不是已經啟動了一個了?還是被別的程序佔用了?