gpt4 book ai didi

mysql - 在 Amazon EC2 上安装 DBD::mysql 时无法找到 mysql_config

转载 作者:行者123 更新时间:2023-12-01 00:24:11 24 4
gpt4 key购买 nike

我正在运行一个 Amazon EC2 实例(uname -r 给出“3.4.43-43.43.amzn1.x86_64”)并尝试设置 DBD::mysql 以便与我的 Perl 脚本一起使用。

使用 cpanm 安装 DBD::mysql:cpanm --sudo DBD::mysql

这将返回一个错误并包含以下日志文​​件:

You have /usr/bin/unzip Searching DBD::mysql on cpanmetadb ...
--> Working on DBD::mysql Fetching http://www.cpan.org/authors/id/C/CA/CAPTTOFU/DBD-mysql-4.023.tar.gz
-> OK Unpacking DBD-mysql-4.023.tar.gz Entering DBD-mysql-4.023 Checking configure dependencies from META.yml Checking if you have DBI
1.08 ... Yes (1.627) Configuring DBD-mysql-4.023 Running Makefile.PL 64 lines yanked 1,1 Top

perl Makefile.PL --testuser=username

Can't exec "mysql_config": No such file or directory at Makefile.PL line 479.
Can't find mysql_config. Use --mysql_config option to specify where mysql_config is located
Can't exec "mysql_config": No such file or directory at Makefile.PL line 479.
Can't find mysql_config. Use --mysql_config option to specify where mysql_config is located
Can't exec "mysql_config": No such file or directory at Makefile.PL line 479. Failed to determine directory of mysql.h. Use

perl Makefile.PL --cflags=-I<dir>

to set this directory. For details see the INSTALL.html file, section "C Compiler flags" or type

perl Makefile.PL --help Can't find mysql_config. Use --mysql_config option to specify where mysql_config is located
-> N/A
-> FAIL Configure failed for DBD-mysql-4.023. See /home/ec2-user/.cpanm/work/1373404386.28268/build.log for details.

我尝试在整个系统上搜索 mysql_config,但一无所获。我已经用谷歌搜索了几个小时,但没有找到解决方案。任何帮助深表感谢!谢谢

最佳答案

在 ubuntu 中只需安装libmysqlclient-dev

sudo apt-get install libmysqlclient-dev

关于mysql - 在 Amazon EC2 上安装 DBD::mysql 时无法找到 mysql_config,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/17572951/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com