Bonjour bonjour.
Quelques informations techniques :
- Windows XP
- MySQL 5.0.51b
J'ai installé ActivePerl 5.10.2 sur une machine n'ayant pas accès au net, et j'ai également besoin de lui ajouter le module nécessaire pour se connecter à une BDD de type MySQL.
Je vous avoue un peu galérer sur ce coup, car il semble que tout se fasse, en Perl, via l'utilisation de ppm. Cependant, comme la machine sur laquelle j'essaie d'installer le module n'est pas connecté au net, ben je me casse les dents quoi .
J'ai donc été jeté un coup d'oeil sur le fichier d'install du module DBD-mysql-4.007, sur le site du CPAN.
http://search.cpan.org/src/CAPTTOFU/...8/INSTALL.html
Et me voilà parti pour installer à la main à partir de la source, puisque tous les paquetages binaires font appel à ppm.
1. Les prérequis :
- Perl : OK
- MySQL : OK
- DBI : il est disponible dans l'interface graphique du ppm donc OK
- un compilateur C : aucune idée
- Gzip libraries : OK
Première question : comment faire pour voir si je dispose d'un compilateur C. hum, je ne sais pas trop s'il y a un compilateur C de base sur un Windows XP ^_^.
2. Je me suis quand même tenté l'install. Voilà ce que ça donne :
2.1 j'ai créé une base de données test et un nouveau user perl
2.2 Dans une fenêtre de commande MS-DOS, je tape la commande suivante :
perl Makefile.PL --testdb=test
J'ai alors l'erreur suivante :
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25
| Use of uninitialized value $ENV{"USER"} in concatenation (.) or string at Makefile.PL line 500.
Use of uninitialized value in concatenation (.) or string at Makefile.PL line 500.
PLEASE NOTE:
For 'make test' to run properly, you must ensure that the
database user '' can connect to your MySQL server
and has the proper privileges that these tests require such
as 'drop table', 'create table', 'drop procedure', 'create procedure'
as well as others.
mysql> grant all privileges on test.* to ''@'localhost' identified by 's3kr1t';
You can also optionally set the user to run 'make test' with:
perl Makefile.pl --testuser=username
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 |
Voyant qu'il me manquait l'utilisateur + le password de la BDD, j'ai ajouté les options --testuser et --testpassword.
perl Makefile.PL --testdb=test --testuser=<MonUser> --testpassword=<MonPwd>
J'ai alors obtenu l'erreur suivante :
1 2 3 4 5 6 7 8
| 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 |
Après une rapide recherche, j'ai découvert où se trouvait mysql.h et je l'ai ajouté à ma ligne de commande.
perl Makefile.PL --testdb=test --testuser=<MonUser> --testpassword=<MonPwd> --cflags=-I<MonDirInclude>
J'ai alors buté sur l'erreur suivante :
1 2 3 4 5 6 7 8
| Failed to determine directory of mysqlclient.lib. Use
perl Makefile.PL "--libs=-L<dir> -lmysqlclient -lz -lm -lcrypt -lnsl"
to set this directory. For details see the INSTALL.html file,
section "Linker flags" or type
perl Makefile.PL --help |
J'ai donc fait un recherche et j'ai trouvé deux fichiers mysqlclient.lib dans l'arborescence de MySQL :
- un dans <MYSQL_INSTALL_DIR>/lib/opt
- un autre dans <MYSQL_INSTALL_DIR>/lib/debug
J'ai opté pour celui dans opt et j'ai ajouté le chemin à ma ligne de commande :
perl Makefile.PL --testdb=test --testuser=<MonUser> --testpassword=<MonPwd> --cflags=-I<MonDirInclude> "--libs=-L<MonDirLibOpt> -lmysqlclient -lz -lm -lcrypt -lnsl"
Et alors, j'ai le message suivant que je ne comprends plus trop .
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58
| I will use the following settings for compiling and testing:
cflags (User's choice) = -I<MonDirInclude>
embedded (guessed ) =
libs (User's choice) = -L<MonDirLibopt> -lmysqlclient -lz -lm -lcrypt -lnsl
nocatchstderr (default ) = 0
nofoundrows (default ) = 0
ssl (guessed ) = 0
testdb (User's choice) = test
testhost (default ) =
testpassword (User's choice) = <monPwd>
testsocket (default ) =
testuser (User's choice) = <Monusr>
To change these settings, see 'perl Makefile.PL --help' and
'perldoc INSTALL'.
Argument "6.42_01" isn't numeric in numeric ge (>=) at Makefile.PL line 355.
Checking if your kit is complete...
Looks good
Note (probably harmless): No library found for -lz
Note (probably harmless): No library found for -lm
Note (probably harmless): No library found for -lcrypt
Note (probably harmless): No library found for -lnsl
Note (probably harmless): No library found for oldnames.lib
Note (probably harmless): No library found for kernel32.lib
Note (probably harmless): No library found for user32.lib
Note (probably harmless): No library found for gdi32.lib
Note (probably harmless): No library found for winspool.lib
Note (probably harmless): No library found for comdlg32.lib
Note (probably harmless): No library found for advapi32.lib
Note (probably harmless): No library found for shell32.lib
Note (probably harmless): No library found for ole32.lib
Note (probably harmless): No library found for oleaut32.lib
Note (probably harmless): No library found for netapi32.lib
Note (probably harmless): No library found for uuid.lib
Note (probably harmless): No library found for ws2_32.lib
Note (probably harmless): No library found for mpr.lib
Note (probably harmless): No library found for winmm.lib
Note (probably harmless): No library found for version.lib
Note (probably harmless): No library found for odbc32.lib
Note (probably harmless): No library found for odbccp32.lib
Note (probably harmless): No library found for msvcrt.lib
*** You're using Microsoft Visual C++ compiler or similar but
the LIB and INCLUDE environment variables are not both set.
You need to run the VCVARS32.BAT batch file that was supplied
with the compiler before you can use it.
A copy of vcvars32.bat can typically be found in the following
directories under your Visual Studio install directory:
Visual C++ 6.0: vc98\bin
Visual Studio .NET: vc7\bin
Find it, run it, then retry this.
If you think this error is not correct then just set the LIB and
INCLUDE environment variables to some value to disable the check. |
Mon petit doigt me dit que c'est cette histoire de compilateur qui me pose problème ^_^. J'ai fait une recherche pour trouver vcvars32.bat, mais pas moyen de le trouver et donc je ne peux pas utiliser la solution du "find it, run it, then retry this".
1. Faut-il que je récupère un autre compilateur C, style, euh, gcc ou quelque chose dans le genre ?
2. Une fois que tout est compilé, est-ce que je peux choper le résultat et l'ajouter sur n'importe quelle autre station, sans repasser par toutes ces étapes ?
(en fait, je répugne un peu à installer un compilateur C sur la machine qui n'a pas accès au Net).
Merci d'avance pour votre aide.
Bahan
Partager