看板 FreeBSD 關於我們 聯絡資訊
※ 引述《TPPCMAN ()》之銘言: : 要判定 在9.3上面有安裝成功 則是在 sh 跑完後 : 執行 perl test.pl 檔 : 執行的結果會在文字模式 列出一個小表格 : 11.1 執行 perl test.pl 則是 出現如下錯誤 : Can't locate Mysql.pm in @INC (you may need to install the Mysql module) (@INC contains: /usr/local/lib/perl5/site_perl/mach/5.24 /usr/local/lib/perl5/site_perl /usr/local/lib/perl5/5.24/mach /usr/local/lib/perl5/5.24 .) at test.pl line 2. : BEGIN failed--compilation aborted at test.pl line 2. 照 log 猜...不知道是不是 p5-DBD-mysql 之類沒安裝? https://www.freshports.org/databases/p5-DBD-mysql/ 又或是大小寫? ( mysql.pm v.s. Mysql.pm ) 或是要再跟前面的人確認他當時用的版本是不是也另外打包自己才有的東西? : 一開始 我猜想 或許是 作業系統太舊 而 pkg 太舊 : 也下載了 或是 ports裝 比較適於11.1的pkg : 但錯誤依舊 : 還蠻傷腦筋的 : --------------附上 test.pl 內容--------------- : #!/usr/bin/perl : use Mysql; : $dbh=Mysql->connect("localhost","mysql","root","XXXX"); : $q_str="show databases"; : $row=$dbh->query($q_str); : while(($db)=$row->fetchrow) { : $q_str = "show tables from $db"; : $row1=$dbh->query($q_str); : while(($tbl)=$row1->fetchrow) { : $q_str="alter table $db.$tbl type=MyISAM;"; : print "$q_str\n"; : } : } -- Paramore - Franklin And when we get home, I know we won't be home at all This place we live, it is not where we belong And I miss who we were in the town that we could call our own Going back to get away after everything has changed -- ※ 發信站: 批踢踢實業坊(ptt.cc), 來自: 140.116.101.37 ※ 文章網址: https://www.ptt.cc/bbs/FreeBSD/M.1526521182.A.551.html