原網址 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