Skip to content

Instantly share code, notes, and snippets.

@rymizuki
Created April 16, 2014 04:53
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save rymizuki/10808636 to your computer and use it in GitHub Desktop.
Save rymizuki/10808636 to your computer and use it in GitHub Desktop.

DBD::mysqlのインストールがうまくいかない

You can also optionally set the user to run 'make test' with:

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/mizuki/.cpanm/work/1371739075.4124/build.log for details.
(mizuki)$ project/NoPaste-Beta                                                                                                                                                                             [~]
(mizuki)$ plenv exec cpanm --look DBD::mysql                                                                                                                                          [~/project/NoPaste-Beta]
--> Working on DBD::mysql
Fetching http://www.cpan.org/authors/id/C/CA/CAPTTOFU/DBD-mysql-4.023.tar.gz ... OK
Entering /home/mizuki/.cpanm/work/1371739530.4673/DBD-mysql-4.023 with /bin/zsh
(mizuki)$ /home/mizuki/.cpanm/work/1371739530.4673/DBD-mysql-4.023                                                                                             [~/.cpanm/work/1371739530.4673/DBD-mysql-4.023]
(mizuki)$ ls                                                                                                                                                   [~/.cpanm/work/1371739530.4673/DBD-mysql-4.023]
ChangeLog  INSTALL.html  MANIFEST  MANIFEST.SKIP  META.yml  Makefile.PL  Makefile.PL.embedded  README  README.OSX  TODO  constants.h  dbdimp.c  dbdimp.h  eg  lib  myld  mysql.xs  t
(mizuki)$ 
(mizuki)$ perl Makefile.PL --testuser=root --testpassword=manekineko --mysql_config=/usr/bin/mysql_config                                                      [~/.cpanm/work/1371739530.4673/DBD-mysql-4.023]
Can't locate DBI/DBD.pm in @INC (you may need to install the DBI::DBD module) (@INC contains: /home/mizuki/local/lib/perl5//x86_64-linux /home/mizuki/local/lib/perl5/ /home/mizuki/.plenv/versions/5.18.0/lib/perl5/site_perl/5.18.0/x86_64-linux /home/mizuki/.plenv/versions/5.18.0/lib/perl5/site_perl/5.18.0 /home/mizuki/.plenv/versions/5.18.0/lib/perl5/5.18.0/x86_64-linux /home/mizuki/.plenv/versions/5.18.0/lib/perl5/5.18.0 .) at Makefile.PL line 25.

DBIが無くてだめっぽいので足りないモジュールを入れる>cpanfileつかってないから後ではまりそう

(mizuki)$ plenv exec cpanm DBI::DBD                                                                                                                            [~/.cpanm/work/1371739530.4673/DBD-mysql-4.023]
--> Working on DBI::DBD
Fetching http://www.cpan.org/authors/id/T/TI/TIMB/DBI-1.627.tar.gz ... OK
Configuring DBI-1.627 ... OK
Building and testing DBI-1.627 ... OK
Successfully installed DBI-1.627
1 distribution installed

(mizuki)$ perl Makefile.PL --testuser=root --testpassword=yourpasswd --mysql_config=/usr/bin/mysql_config [~/.cpanm/work/1371739530.4673/DBD-mysql-4.023] I will use the following settings for compiling and testing:

cflags (mysql_config ) = -I/usr/include/mysql -DBIG_JOINS=1 -fno-strict-aliasing -DUNIV_LINUX -DUNIV_LINUX embedded (mysql_config ) = ldflags (mysql_config ) = -Wl,-Bsymbolic-functions -rdynamic libs (mysql_config ) = -L/usr/lib/mysql -lmysqlclient mysql_config (Users choice ) = /usr/bin/mysql_config nocatchstderr (default ) = 0 nofoundrows (default ) = 0 ssl (guessed ) = 0 testdb (default ) = test testhost (default ) = testpassword (User's choice) = manekineko testsocket (default ) = testuser (User's choice) = root

To change these settings, see 'perl Makefile.PL --help' and 'perldoc INSTALL'.

Checking if your kit is complete... Looks good Using DBI 1.627 (for perl 5.018000 on x86_64-linux) installed in /home/mizuki/.plenv/versions/5.18.0/lib/perl5/site_perl/5.18.0/x86_64-linux/auto/DBI/ Writing Makefile for DBD::mysql Writing MYMETA.yml and MYMETA.json (mizuki)$ make && make test [~/.cpanm/work/1371739530.4673/DBD-mysql-4.023]


rootじゃログインできなかった

(mizuki)$ perl Makefile.PL --testuser=mizuki --testpassword=yourpasswd --mysql_config=/usr/bin/mysql_config [~/.cpanm/work/1371739530.4673/DBD-mysql-4.023] I will use the following settings for compiling and testing:

cflags (mysql_config ) = -I/usr/include/mysql -DBIG_JOINS=1 -fno-strict-aliasing -DUNIV_LINUX -DUNIV_LINUX embedded (mysql_config ) = ldflags (mysql_config ) = -Wl,-Bsymbolic-functions -rdynamic libs (mysql_config ) = -L/usr/lib/mysql -lmysqlclient mysql_config (Users choice ) = /usr/bin/mysql_config nocatchstderr (default ) = 0 nofoundrows (default ) = 0 ssl (guessed ) = 0 testdb (default ) = test testhost (default ) = testpassword (User's choice) = manekineko testsocket (default ) = testuser (User's choice) = mizuki

To change these settings, see 'perl Makefile.PL --help' and 'perldoc INSTALL'.

Using DBI 1.627 (for perl 5.018000 on x86_64-linux) installed in /home/mizuki/.plenv/versions/5.18.0/lib/perl5/site_perl/5.18.0/x86_64-linux/auto/DBI/ Writing Makefile for DBD::mysql Writing MYMETA.yml and MYMETA.json (mizuki)$ make && make test [~/.cpanm/work/1371739530.4673/DBD-mysql-4.023]



mysql_configがない場合
以下のパッケージに含まれている

(mizuki)$ sudo apt-get install libmysqlclient15-dev

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment