简体   繁体   English

install_driver(mysql)失败:找不到DBD / mysql.pm

[英]install_driver(mysql) failed: Can't locate DBD/mysql.pm

Question is not repeated, first read the problem which I am facing, then mark it if it is repeated, will be helpful if repeatation of my question helps me in solving my problem, As I have been through all the links and solutions mentioned on other similar questions and problems but no luck. 问题不再重复,首先阅读我所面临的问题,然后将其标记为重复,如果重复我的问题可以帮助我解决问题,这将是有帮助的,因为我已经遍及其他提到的所有链接和解决方案类似的问题,但没有运气。

I am trying to setup redmine git on my ec2-aws-instance with help of below link 我正在尝试通过以下链接在我的ec2-aws-instance上设置redmine git

https://docs.bitnami.com/installer/how-to/configure-advanced-integration-git-redmine/ https://docs.bitnami.com/installer/how-to/configure-advanced-integration-git-redmine/

I am able to properly connect redmine projects with my git repositories but once I reach third step on above link I am facing issue as below 我能够将Redmine项目与git存储库正确连接,但是一旦到达上述链接的第三步,我将面临以下问题

step :- 3 Configure Git Access Control 步骤:-3 配置Git访问控制

Below is the error when try to secure my git repository with redmine user credentials. 以下是尝试使用Redmine用户凭据保护我的git存储库时的错误。

[Thu Feb 21 17:46:26.918619 2019] [perl:error] [pid 26820:tid 139790464616192] [client 127.0.0.1:50156] install_driver(mysql) failed: Can't locate DBD/mysql.pm in @INC (@INC contains: /opt/bitnami/git/lib/site_perl/5.16.3 /opt/bitnami/perl/lib/5.16.3/x86_64-linux-thread-multi /opt/bitnami/perl/lib/5.16.3 /opt/bitnami/perl/lib/site_perl/5.16.3/x86_64-linux-thread-multi /opt/bitnami/perl/lib/site_perl/5.16.3 /opt/bitnami/perl/lib/5.16.3/x86_64-linux-thread-multi /opt/bitnami/perl/lib/site_perl/5.16.3/x86_64-linux-thread-multi /bitnami/ruby23stack-linux-x64/output/perl/lib/site_perl/5.16.3/x86_64-linux-thread-multi /bitnami/ruby23stack-linux-x64/output/perl/lib/site_perl/5.16.3 /bitnami/ruby23stack-linux-x64/output/perl/lib/5.16.3/x86_64-linux-thread-multi /bitnami/ruby23stack-linux-x64/output/perl/lib/5.16.3 . /opt/bitnami/apache2) at (eval 6) line 3.\\nPerhaps the DBD::mysql perl module hasn't been fully installed,\\nor perhaps the capitalisation of 'mysql' isn't right.\\nAvailable drivers [Thu Feb 21 17:46:26.918619 2019] [perl:error] [pid 26820:tid 139790464616192] [client 127.0.0.1:50156] install_driver(mysql)失败:无法在@INC中找到DBD / mysql.pm( @INC包含:/opt/bitnami/git/lib/site_perl/5.16.3 /opt/bitnami/perl/lib/5.16.3/x86_64-linux-thread-multi /opt/bitnami/perl/lib/5.16.3 /opt/bitnami/perl/lib/site_perl/5.16.3/x86_64-linux-thread-multi /opt/bitnami/perl/lib/site_perl/5.16.3 /opt/bitnami/perl/lib/5.16.3/x86_64 -linux-thread-multi /opt/bitnami/perl/lib/site_perl/5.16.3/x86_64-linux-thread-multi /bitnami/ruby23stack-linux-x64/output/perl/lib/site_perl/5.16.3/x86_64 -linux-thread-multi /bitnami/ruby23stack-linux-x64/output/perl/lib/site_perl/5.16.3 /bitnami/ruby23stack-linux-x64/output/perl/lib/5.16.3/x86_64-linux-thread在(eval 6)第3行的-multi /bitnami/ruby23stack-linux-x64/output/perl/lib/5.16.3./opt/bitnami/apache2)。\\n也许DBD :: mysql perl模块尚未完全安装已安装,\\也可能'mysql'的大写不正确。\\ n可用的驱动程序 : DBM, ExampleP, File, Gofer, Proxy, Sponge.\\n at /opt/bitnami/perl/lib/site_perl/5.16.3/x86_64-linux-thread-multi/Apache/Redmine.pm line 557.\\n App 26921 stdout: :DBM,ExampleP,文件,Gofer,代理,海绵。\\ n位于/opt/bitnami/perl/lib/site_perl/5.16.3/x86_64-linux-thread-multi/Apache/Redmine.pm第557行。\\ n应用26921标准输出:

Without third step my repositories are public, any who knows the repo url can clone my repos or perform other operations on my git repos. 没有第三步,我的存储库便是公共的,任何知道该存储库URL的人都可以克隆我的存储库或对我的git存储库执行其他操作。 So third step is for security purpose as per above document link and which is important for me. 因此,根据上述文档链接,第三步出于安全目的,这对我很重要。

Once I add below line into apache config as per documentation mentioned I am getting above error in my bitnami log when I try to clone a repository 一旦我按照文档提到的将以下行添加到apache配置中,当我尝试克隆存储库时,我的bitnami日志中遇到了以上错误

 <Location "/">
       AuthType Basic
       AuthName "Redmine git repositories"
       Require valid-user

       PerlAccessHandler Apache::Authn::Redmine::access_handler
       PerlAuthenHandler Apache::Authn::Redmine::authen_handler
       RedmineDSN "DBI:mysql:database=bitnami_redmine;host=localhost;mysql_socket=installdir/mysql/tmp/mysql.sock"
       RedmineDbUser "REDMINE_DB_USERNAME"
       RedmineDbPass "REDMINE_DB_PASSWORD"
       RedmineGitSmartHttp yes
     </Location>

When I run a following command to clone a repo, without third step on documentation, I am properly able to clone the repo, but with third step I am failing and getting above error in log and below error on command line. 当我运行以下命令来克隆存储库时,无需进行文档上的第三步操作,我就可以正确地克隆存储库,但是在执行第三步时,我失败了,并且日志中的错误高于命令行中的错误。

bitnami@127.0.0.1:/tmp$ git clone http://git.domain.com/test2
Cloning into 'test2'...
fatal: unable to access 'http://git.domain.com/test2/': The requested URL returned error: 500

I have even tried installing below package but no luck 我什至尝试安装以下软件包,但没有运气

sudo apt-get install libdbd-mysql-perl

my os is 我的操作系统是

Ubuntu 16.04.5 LTS \n \l

In order for a Perl installation to talk to a MySQL database, it needs to use the DBD::mysql module. 为了使Perl安装能够与MySQL数据库对话,它需要使用DBD :: mysql模块。 This module isn't part of the standard Perl installation and needs to be installed separately. 该模块不是标准Perl安装的一部分,需要单独安装。 When you install it using the CPAN command line tool ( cpan DBD::mysql ) or using apt-get ( apt-get install libdbd-mysql-perl ) it is installed in the library directories used by the system Perl (the one that is installed as part of your operating system). 使用CPAN命令行工具( cpan DBD::mysql )或使用apt-getapt-get install libdbd-mysql-perl )安装它时,它将安装在系统Perl使用的库目录中(即作为操作系统的一部分安装)。 You can confirm that this has been installed correctly by running the following commands: 您可以通过运行以下命令来确认已正确安装:

$ perldoc DBD::mysql
$ perl -MDBD::mysql -le'print $DBD::mysql::VERSION'

If DBD::mysql is installed correctly, the first command will show you the documentation for the module and the second will give the version number. 如果正确安装了DBD :: mysql,则第一个命令将向您显示该模块的文档,第二个命令将提供版本号。

But, as I said, this is installed for use by the system Perl installation. 但是,正如我所说的,这是为系统Perl安装所安装的。 It appears from the error message you're seeing that your Bitnami installation isn't using the system Perl. 从错误消息中可以看到,您看到您的Bitnami安装未使用系统Perl。 It is, instead, using a separate Perl installation which is installed in /opt/bitnami . 相反,它使用/opt/bitnami安装的单独的Perl安装。

So you need to get DBD::mysql installed in the module library for this Perl installation. 因此,您需要在此Perl安装的模块库中安装DBD :: mysql。 It's possible to ask cpan to install a module in a different directory, but I'd be wary about just installing stuff into Bitnami's directory tree. 可以要求cpan在其他目录中安装模块,但是我会警惕仅将内容安装到Bitnami的目录树中。 I strongly suspect that an installation step has been skipped far earlier in the process. 我强烈怀疑在此过程的较早阶段已跳过了安装步骤。 If Bitnami needs to use MySQL from a Perl program and installs its own Perl distribution complete with its own module library, then it should either include DBD::mysql in its installation or provide clear instructions on how to install it. 如果Bitnami需要使用Perl程序中的MySQL并安装带有自己的模块库的Perl发行版,则它应该在安装中包括DBD :: mysql或提供有关如何安装它的明确说明。

My suggestion would be to carefully go over the installation instructions for Bitnami and see what they have to say about installing MySQL support. 我的建议是仔细阅读Bitnami的安装说明,看看他们对安装MySQL支持的看法。 If that doesn't work, you should take this question to Bitnami's support channels. 如果这不起作用,您应该将这个问题带到Bitnami的支持渠道。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM