cacti config.php,安装cacti过程中的各种报错以及解决方法

(1)Starting MySQL... ERROR! The server quit without updating PID file

原因:没有初始化权限表

解决方法:

[root@localhost ~]# cd /usr/local/mysql

[root@localhost mysql]# chown -R mysql.mysql .

[root@localhost mysql]# su - mysql

(2)报错:This account is currently not available(显示用户不可用)

原因:用户被指定到/sbin/nologin下了

解决方法:usermod -s /bin/bash mysql

[mysql@localhost ~]$ cd /usr/local/mysql

[mysql@localhost mysql]$ scripts/mysql_install_db

Installing MySQL system tables...OKFilling help tables...OK

To start mysqld at boot time you have to copysupport-files/mysql.server to the right place for your system

PLEASE REMEMBER TO SET A PASSWORD FOR THE MySQL root USER !To do so, start the server, then issue the following commands:

./bin/mysqladmin -u root password 'new-password'./bin/mysqladmin -u root -h localhost.localdomain password 'new-password'

Alternatively you can run:./bin/mysql_secure_installation

which will also give you the option of removing the testdatabases and anonymous user created by default.  This isstrongly recommended for production servers.

See the manual for more instructions.

You can start the MySQL daemon with:cd . ; ./bin/mysqld_safe &

You can test the MySQL daemon with mysql-test-run.plcd ./mysql-test ; perl mysql-test-run.pl

Please report any problems with the ./bin/mysqlbug script!

[mysql@localhost mysql]$ /usr/local/mysql/bin/mysqld_safe --user=mysql &

[1] 11767[mysql@localhost mysql]$ 120502 07:01:17 mysqld_safe Logging to '/usr/local/mysql/data/localhost.localdomain.err'.120502 07:01:17 mysqld_safe Starting mysqld daemon with databases from /usr/local/mysql/data[mysql@localhost mysql]$ /etc/rc.d/init.d/mysql statusMySQL running (11830)

(3)报错:ERROR! MySQL isrunningbut PIDfilecouldnot befound原因:最常见的通常是PID进程未全部关闭比如启动safemysqld进程后未关闭

运行 /etc/init.d/mysqlstatus会提示ERROR! MySQL is running but PID file could not be found

解决方法:

先打印MYSQL进程ps aux | grep mysql

然后KILL进程kill -9 pid1 pid2 …

在启动MYSQL/etc/init.d/mysql start在检查/etc/init.d/mysql statusSUCCESS! MySQL running (10021)这个只是其中一个原因还有其他的 大部分的错误可以在日志里查看到Centos mysql的日志在/var/lib/mysql/主机头名称xxx.err

(4)在安装cacti的页面报错:

FATAL: Cannot connect to MySQL server on 'localhost'. Please make sure you have specified a valid MySQL database name in 'include/config.php'

原因:

1)、查看config.php下,是否配置正确查看cactiusr的host是否有localhost 权限

mysql -ucactiuser -h localhost -p

查看登录是否成功 ,如果登录正常则排除2)、MYSQL权限问题

SQL>GRANT ALL ON cacti.* TO cactiuser@localhost IDENTIFIED BY 'somepassword';

3)、当mysql中的所有配置和cacti的config.php都正确,却还是出现该错误时,那就是mysql套接字的原因了~cacti会自动的去查找/var/lib/mysql/mysql.sock 该套接字,但是如果是源码安装的mysql,未指定套接字位置时,套接字的位置为/tmp/mysql.sock,由于cacti未找到/var/lib/mysql/mysql.sock,所以显示的是“Cannot connect to MySQL server on 'localhost'”解决:做一个/tmp/mysql.sock到/var/lib/mysql/mysql.sock的软连接

ln -s  /tmp/mysql.sock  /var/lib/mysql/mysql.sock

(5)Cacti图形显示红叉

执行/usr/bin/php /var/www/html/cacti/poller.php稍等片刻刷新页面即可

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值