安装lepus,启动失败,报错:Access denied for user 'root'@'localhost' (using password: YES)(示例代码
Posted yangtou45du
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了安装lepus,启动失败,报错:Access denied for user 'root'@'localhost' (using password: YES)(示例代码相关的知识,希望对你有一定的参考价值。
在搭建lepus过程中,lepus启动失败
用tail -f /usr/local/lepuslogs/lepus.log查看错误日志为:
import functions as func
File "./include/functions.py", line 285, in <module>
mail_host = get_option(\'smtp_host\')
File "./include/functions.py", line 242, in get_option
conn=mysqldb.connect(host=host,user=user,passwd=passwd,port=int(port),connect_timeout=5,charset=\'utf8\')
File "/usr/lib64/python2.6/site-packages/MySQLdb/__init__.py", line 81, in Connect
return Connection(*args, **kwargs)
File "/usr/lib64/python2.6/site-packages/MySQLdb/connections.py", line 193, in __init__
super(Connection, self).__init__(*args, **kwargs2)
_mysql_exceptions.OperationalError: (1045, "Access denied for user \'root\'@\'localhost\' (using password: YES)")
应该是mysql的原因,直接输入mysql可以登录,用mysql -uroot -p登录报错
先用mysql等录进去,查看数据库,发现先前配置的lepus数据库不在了,
重新执行以下命令,成功
1.在监控机创建监控数据库,并授权。
mysql> create database lepus default character set utf8;
mysql> grant select,insert,update,delete,create on lepus.* to \'root\'@\'localhost\' identified by \'123456\';
mysql> flush privileges;
2.导入SQL文件夹里的初始化SQL文件(表结构和数据文件)
/usr/local/lepus/sql 这个地方执行以下2个语句
# mysql -uroot -p lepus < sql/lepus_table.sql
# mysql -uroot -p lepus < sql/lepus_data.sql
最后lepus重启成功!!!
以上是关于安装lepus,启动失败,报错:Access denied for user 'root'@'localhost' (using password: YES)(示例代码的主要内容,如果未能解决你的问题,请参考以下文章