Chinaunix首页 | 论坛 | 博客
  • 博客访问: 746688
  • 博文数量: 95
  • 博客积分: 1754
  • 博客等级: 上尉
  • 技术积分: 1607
  • 用 户 组: 普通用户
  • 注册时间: 2010-03-12 10:06
文章分类

全部博文(95)

文章存档

2015年(3)

2013年(15)

2012年(77)

分类: Python/Ruby

2012-12-27 17:21:14

刚开始使用:cpan DBD::mysql 命令来安装该模块
由于是编译的版本的SQL版本,已经在/etc/profile 中修改:export PATH=/usr/local/mysql/bin:$PATH
担心找不到mysql lib文件。


报错如下:
# Tried to use 'DBD::mysql'.
# Error: Can't load '/root/.cpan/build/DBD-mysql-4.022/blib/arch/auto/DBD/mysql/mysql.so' for module DBD::mysql: libmysqlclient.so.16: 无法打开共享对象文件: 没有那个文件或目录 at /usr/lib64/perl5/5.8.8/x86_64-linux-thread-multi/DynaLoader.pm line 230.
# at (eval 6) line 2
# Compilation failed in require at (eval 6) line 2.
# BEGIN failed--compilation aborted at t/00base.t line 21.
FAILED--Further testing stopped: Unable to load DBD::mysql
make: *** [test_dynamic] 错误 9
/usr/bin/make test -- NOT OK
Running make install
make test had returned bad status, won't install without force
[root@localhost dbdata_backup]# perl -MCPAN -e shell
Terminal does not support AddHistory.

cpan shell -- CPAN exploration and modules installation (v1.7602)
ReadLine support available (try 'install Bundle::CPAN')

解决方式:
shell> perl -MCPAN -e shell
cpan> install DBI
cpan> install DBD::mysql
安装成功。

手工安装DBD安装技巧:
注意mysql的环境变量,若没有则用 添加/usr/local/mysql/bin到环境变量PATH中
PATH=/usr/local/mysql/bin:$PATH;
export PATH (mysql的安装路径根据实际情况填写)
wget
 tar -zxvf DBD-mysql-4.006.tar.gz
 cd DBD-mysql-4.006
 perl Makefile.PL –mysql_config=/usr/local/mysql/bin/mysql_config
 make
 make test
 make install



阅读(12113) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~