原网址 http://blog.csdn.net/nemo2011/article/details/8996415
安装perl后, 因为想要运行innotop,mytop之类的perl文件。 所以出现了一系列问题:
1. Can't locate Time/HiRes.pm in
原因:perl包没有安装完全。
解决办法:
.pm实际上是Perl的包,只需安装如下软件包即可:
[cpp] view plaincopy
<span style="font-size:14px;">yum install perl-Time-HiRes</span>
2. failed: Can't locate DBD/mysql.pm in
原因1: 可能是perl-DBD-MySQL没安装。
[cpp] view plaincopy
<span style="font-size:14px;">yum install perl-DBD-MySQL</span>
虽然我用yum安装了perl-DBD-MySQL, 但是还是不不成功。 依然是报这个错误。
问题没有解决。
原因2: DBD-mysql没有安装,下载DBD-mysql。
[cpp] view plaincopy
<span style="font-size:14px;">解压:tar xzvf DBD-mysql**.tar.gz
进入该目录:cd DBD-mysql*
</span>
下面的要注意了:
[cpp] view plaincopy
<span style="font-size:14px;">perl Makefile.PL --mysql_config=/usr/lib64/mysql/mysql_config</span>
如果不在lib64目录下的话, 请find下它。
接下来是更蛋疼的事情-----make。
[cpp] view plaincopy
<span style="font-size:14px;">make</span>
结果出现了:
[cpp] view plaincopy
<span style="font-size:14px;">dbdimp.c:4650: error: 'imp_dbh_t' has no member named 'async_query_in_flight'
dbdimp.c:4693: error: 'imp_sth_t' has no member named 'params'
dbdimp.c:4693: warning: passing argument 1 of 'bind_param' from incompatible pointer type
dbdimp.c:798: note: expected 'struct imp_sth_ph_t *' but argument is of type 'const struct sql_type_info_
dbdimp.c: In function 'mysql_db_reconnect':
dbdimp.c:4839: error: 'MYSQL' undeclared (first use in this function)
dbdimp.c:4839: error: expected ';' before 'save_socket'
dbdimp.c:4849: error: 'imp_dbh_t' has no member named 'pmysql'
dbdimp.c:4849: error: 'CR_SERVER_GONE_ERROR' undeclared (first use in this function)
dbdimp.c:4849: warning: comparison between pointer and integer
dbdimp.c:4853: error: 'imp_dbh_t' has no member named 'auto_reconnect'
dbdimp.c:4867: error: 'save_socket' undeclared (first use in this function)
dbdimp.c:4867: error: 'imp_dbh_t' has no member named 'pmysql'
dbdimp.c:4868: error: 'imp_dbh_t' has no member named 'pmysql'
dbdimp.c:4868: warning: passing argument 3 of 'memcpy' makes integer from pointer without a cast
/usr/include/bits/string3.h:49: note: expected 'size_t' but argument is of type 'const struct sql_type_in
dbdimp.c:4869: error: 'imp_dbh_t' has no member named 'pmysql'
dbdimp.c:4869: error: 'imp_dbh_t' has no member named 'pmysql'
dbdimp.c:4869: warning: passing argument 1 of 'memset' discards qualifiers from pointer target type
/usr/include/bits/string3.h:77: note: expected 'void *' but argument is of type 'const struct sql_type_in
dbdimp.c:4877: error: 'imp_dbh_t' has no member named 'pmysql'
dbdimp.c:4877: error: 'imp_dbh_t' has no member named 'pmysql'
dbdimp.c:4878: warning: passing argument 3 of 'mysql_dr_error' makes pointer from integer without a cast
dbdimp.c:1429: note: expected 'const char *' but argument is of type 'int'
dbdimp.c:4879: error: 'imp_dbh_t' has no member named 'pmysql'
dbdimp.c:4879: warning: passing argument 1 of 'memcpy' discards qualifiers from pointer target type
/usr/include/bits/string3.h:49: note: expected 'void * __restrict__' but argument is of type 'const struc
dbdimp.c:4879: warning: passing argument 3 of 'memcpy' makes integer from pointer without a cast
/usr/include/bits/string3.h:49: note: expected 'size_t' but argument is of type 'const struct sql_type_in
dbdimp.c:4880: error: 'imp_dbh_t' has no member named 'stats'
dbdimp.c:4880: error: request for member 'auto_reconnects_failed' in something not a structure or union
dbdimp.c:4880: error: lvalue required as increment operand
dbdimp.c:4889: error: 'imp_dbh_t' has no member named 'stats'
</span>
在dbdimp.c里面出现了一系列的错误。
我查找了/usr/include, 结果发现没有mysql相关的头文件。 哎, 赶紧装相关的头文件吧。
方法一: 编译mysql源码安装mysql。
请参考 编译安装mysql
方法二: yum 安装mysql-devel (我当然推荐这种方法啦)
[cpp] view plaincopy
<span style="font-size:14px;">yum install mysql-devel</span>
查看/usr/include目录, 有了/usr/include/mysql文件夹。
接下来正常进行:
[cpp] view plaincopy
<span style="font-size:14px;">make
make test
make install</span>
发现问题解决了。
参考网站有:
http://bbs.linuxtone.org/thread-9283-1-1.html
http://www.myexception.cn/database/1242750.html
http://blog.sina.com.cn/s/blog_bd84f64e01015nxc.html
http://blog.chinaunix.net/uid-25530360-id-3413319.html
转载于:https://blog.51cto.com/8938691/1700619