perl 用crontab 调用 环境变量的问题
时间:2010-10-10
来源:互联网
PERL 使用DBI 连接数据库
直接执行 perl connmysql.pl 可以完美执行
但是用crontab 调用connmysql.pl 提示缺少
Compilation failed in require at (eval 5) line 3.
Perhaps a required shared library or dll isn't installed where expected
install_driver(mysql) failed: Can't load 'mysql.so' for module DBD::mysql: libmysql
client.so.16: cannot open shared object file: Permission denied at DynaLoader.pm line 230.
在connmysql.pl内容中添加 在.bash_profile 相对应得EXPORT的值,还是出现上面的故障
$ENV{'PATH'}
$ENV{'LD_LIBRARY_PATH'}
$ENV{'PERL5LIB'}
求此类问题的解决方法
PERL大拿帮助呀
直接执行 perl connmysql.pl 可以完美执行
但是用crontab 调用connmysql.pl 提示缺少
Compilation failed in require at (eval 5) line 3.
Perhaps a required shared library or dll isn't installed where expected
install_driver(mysql) failed: Can't load 'mysql.so' for module DBD::mysql: libmysql
client.so.16: cannot open shared object file: Permission denied at DynaLoader.pm line 230.
在connmysql.pl内容中添加 在.bash_profile 相对应得EXPORT的值,还是出现上面的故障
$ENV{'PATH'}
$ENV{'LD_LIBRARY_PATH'}
$ENV{'PERL5LIB'}
求此类问题的解决方法
PERL大拿帮助呀
作者: ztj2247 发布时间: 2010-10-10
一个建议是
crontab 命令中,先执行一下. .bash_profile
crontab 命令中,先执行一下. .bash_profile
作者: 珞水的大叔 发布时间: 2010-10-10
QUOTE:
一个建议是
crontab 命令中,先执行一下. .bash_profile
珞水的大叔 发表于 2010-10-10 21:00
crontab 命令中,先执行一下. .bash_profile
珞水的大叔 发表于 2010-10-10 21:00
是在CRONTAB中这样写吗
* * * * * . ~/.bash_profile connmysql.pl >> connmysql.log 2>&1 &
作者: ztj2247 发布时间: 2010-10-10
回复 ztj2247
这样写可能会好点,呵呵,试试看
* * * * * . ~/.bash_profile;perl connmysql.pl >> connmysql.log 2>&1 &
这样写可能会好点,呵呵,试试看
* * * * * . ~/.bash_profile;perl connmysql.pl >> connmysql.log 2>&1 &
作者: 珞水的大叔 发布时间: 2010-10-10
相关阅读 更多
热门阅读
-
office 2019专业增强版最新2021版激活秘钥/序列号/激活码推荐 附激活工具
阅读:74
-
如何安装mysql8.0
阅读:31
-
Word快速设置标题样式步骤详解
阅读:28
-
20+道必知必会的Vue面试题(附答案解析)
阅读:37
-
HTML如何制作表单
阅读:22
-
百词斩可以改天数吗?当然可以,4个步骤轻松修改天数!
阅读:31
-
ET文件格式和XLS格式文件之间如何转化?
阅读:24
-
react和vue的区别及优缺点是什么
阅读:121
-
支付宝人脸识别如何关闭?
阅读:21
-
腾讯微云怎么修改照片或视频备份路径?
阅读:28