最新消息:

dstat Module dstat_mysql5_cmds failed to load

python admin 3857浏览 0评论
[root@aikaiyuan ~]# dstat -cdrnyml  --mysql5-cmds
Module dstat_mysql5_cmds failed to load. (No module named MySQLdb)

需要下载安装 MySQLdb python 库

[root@aikaiyuan ~]# wget http://sourceforge.net/projects/mysql-python/files/mysql-python/1.2.3/MySQL-python-1.2.3.tar.gz
[root@aikaiyuan ~]# tar zxvf MySQL-python-1.2.3.tar.gz
[root@aikaiyuan ~]# cd MySQL-python-1.2.3
[root@aikaiyuan MySQL-python-1.2.3]# python setup.py  install

[root@Selboo ~]# dstat -cdrnyml --mysql5-cmds
Module dstat_mysql5_cmds failed to load. (Cannot interface with MySQL server: connect() argument 3 must be string, not None)

提示缺少参数,参数是通过环境变量添加的

[root@aikaiyuan MySQL-python-1.2.3]# export DSTAT_MYSQL_HOST=127.0.0.1
[root@aikaiyuan MySQL-python-1.2.3]# export DSTAT_MYSQL_USER=root
[root@aikaiyuan MySQL-python-1.2.3]# export DSTAT_MYSQL_PWD='123456'

[root@aikaiyuan MySQL-python-1.2.3]# ./dstat --mysql5-cmds
------mysql5-cmds------
 sel   ins   upd   del
    0     0     0     0
   12     0     0     0
   12     0     0     0
   12     0     0     0^C

转载请注明:爱开源 » dstat Module dstat_mysql5_cmds failed to load

您必须 登录 才能发表评论!