Warning: prerequisite DBD::mysql 1 not found错误解决方案

时间:2023-01-20 18:27:31

在使用perl编译的 DBD::mysql 的时候,进程提示无法编译成功,这里想需要我们手动进行编译相关的包文件;相关错误如下所示;

dbdimp.c: In function 鈓ysql_db_async_result?
dbdimp.c:5049: error: 釳YSQL?undeclared (first use in this function)
dbdimp.c:5049: error: 鈙vsock?undeclared (first use in this function)
dbdimp.c:5049: error: invalid operands to binary *
dbdimp.c:5049: warning: statement with no effect
dbdimp.c:5050: error: 釳YSQL_RES?undeclared (first use in this function)
dbdimp.c:5050: error: 鈅res?undeclared (first use in this function)
dbdimp.c:5050: error: invalid operands to binary *
dbdimp.c:5050: warning: statement with no effect
dbdimp.c:5051: warning: ISO C90 forbids mixed declarations and code
dbdimp.c:5054: error: 鈘esp?undeclared (first use in this function)
dbdimp.c:5055: warning: statement with no effect
dbdimp.c:5069: error: 鈏mp_dbh_t?has no member named 鈇sync_query_in_flight?
dbdimp.c:5073: error: 鈏mp_dbh_t?has no member named 鈇sync_query_in_flight?
dbdimp.c:5073: warning: comparison of distinct pointer types lacks a cast
dbdimp.c:5077: error: 鈏mp_dbh_t?has no member named 鈇sync_query_in_flight?
dbdimp.c:5077: warning: statement with no effect
dbdimp.c:5079: error: 鈏mp_dbh_t?has no member named 鈖mysql?
dbdimp.c:5079: warning: statement with no effect
dbdimp.c:5080: warning: implicit declaration of function 鈓ysql_read_query_result?
dbdimp.c:5082: warning: implicit declaration of function 鈓ysql_store_result?
dbdimp.c:5082: error: assignment of read-only location
dbdimp.c:5082: warning: statement with no effect
dbdimp.c:5085: warning: passing argument 3 of 鈓ysql_dr_error?makes pointer from integer without a cast
dbdimp.c:5086: error: wrong type argument to unary exclamation mark
dbdimp.c:5090: warning: comparison of distinct pointer types lacks a cast
dbdimp.c:5098: error: 鈓y_ulonglong?undeclared (first use in this function)
dbdimp.c:5098: warning: comparison between pointer and integer
dbdimp.c:5099: error: wrong type argument to unary exclamation mark
dbdimp.c:5100: error: 鈏mp_sth_t?has no member named 鈏nsertid?
dbdimp.c:5100: warning: statement with no effect
dbdimp.c:5106: error: 鈏mp_sth_t?has no member named 鈘esult?
dbdimp.c:5107: error: 鈏mp_sth_t?has no member named 鈊one_desc?
dbdimp.c:5107: warning: statement with no effect
dbdimp.c:5108: error: 鈏mp_sth_t?has no member named 鈌etch_done?
dbdimp.c:5108: warning: statement with no effect
dbdimp.c:5111: error: 鈏mp_sth_t?has no member named 鈝arning_count?
dbdimp.c:5111: warning: statement with no effect
dbdimp.c:5096: warning: unused variable 鈏mp_dbh?
dbdimp.c:5115: warning: passing argument 3 of 鈓ysql_dr_error?makes pointer from integer without a cast
dbdimp.c: In function 鈓ysql_db_async_ready?
dbdimp.c:5139: error: 鈏mp_dbh_t?has no member named 鈇sync_query_in_flight?
dbdimp.c:5140: error: 鈏mp_dbh_t?has no member named 鈇sync_query_in_flight?
dbdimp.c:5140: warning: comparison of distinct pointer types lacks a cast
dbdimp.c:5144: error: 鈏mp_dbh_t?has no member named 鈖mysql?
dbdimp.c:5144: error: 鈙ql_type_info_t?has no member named 鈔et?
dbdimp.c:5144: error: request for member 鈌d?in something not a structure or union
dbdimp.c:5144: warning: assignment makes integer from pointer without a cast
make: *** [dbdimp.o] Error 1
  CAPTTOFU/DBD-mysql-4.022.tar.gz
  /usr/bin/make -- NOT OK
Running make test
  Can't test without successful make
Running make install
  Make had returned bad status, install seems impossible
Failed during this command:
 CAPTTOFU/DBD-mysql-4.022.tar.gz              : make NO
解决方法如下,手动编译包文件即可;
 
[root@Slave02 ~]# ls
anaconda-ks.cfg         innotop-1.8.1.tar.gz  sleep.sh
a.pl                    input.txt             success_test.sh
a.txt                   install.log           tablesize.sql
bug.sh                  install.log.syslog    temp.tt
cmake-2.8.5.tar.gz      let.sh                time_take.sh
DBD-mysql-4.018.tar.gz  log.txt               tuning-primer.sh
debug.sh                my_program            us.sh
Desktop                 mysqlspp.sql          xtrabackup-1.6.5.tar.gz
file.sh                 out.txt
[root@Slave02 ~]# tar xzvf DBD-mysql-4.018.tar.gz 
DBD-mysql-4.018/
DBD-mysql-4.018/ChangeLog
DBD-mysql-4.018/constants.h
DBD-mysql-4.018/dbdimp.c
DBD-mysql-4.018/dbdimp.h
DBD-mysql-4.018/eg/
DBD-mysql-4.018/eg/bug14979.pl
DBD-mysql-4.018/eg/bug21028.pl
DBD-mysql-4.018/eg/bug30033.pl
DBD-mysql-4.018/eg/bug30033pg.pl
DBD-mysql-4.018/eg/decimal_test.pl
DBD-mysql-4.018/eg/issue21946.pl
DBD-mysql-4.018/eg/prepare_memory_usage.pl
DBD-mysql-4.018/eg/proc_example1.pl
DBD-mysql-4.018/eg/proc_example2.pl
DBD-mysql-4.018/eg/proc_example2a.pl
DBD-mysql-4.018/eg/proc_example2b.pl
DBD-mysql-4.018/eg/proc_example3.pl
DBD-mysql-4.018/eg/proc_example4.pl
DBD-mysql-4.018/INSTALL.html
DBD-mysql-4.018/lib/
DBD-mysql-4.018/lib/Bundle/
DBD-mysql-4.018/lib/Bundle/DBD/
DBD-mysql-4.018/lib/Bundle/DBD/mysql.pm
DBD-mysql-4.018/lib/DBD/
DBD-mysql-4.018/lib/DBD/mysql/
DBD-mysql-4.018/lib/DBD/mysql/GetInfo.pm
DBD-mysql-4.018/lib/DBD/mysql/INSTALL.pod
DBD-mysql-4.018/lib/DBD/mysql.pm
DBD-mysql-4.018/Makefile.PL
DBD-mysql-4.018/Makefile.PL.embedded
DBD-mysql-4.018/MANIFEST
DBD-mysql-4.018/MANIFEST.SKIP
DBD-mysql-4.018/META.yml
DBD-mysql-4.018/myld
DBD-mysql-4.018/mysql.xs
DBD-mysql-4.018/README
DBD-mysql-4.018/t/
DBD-mysql-4.018/t/00base.t
DBD-mysql-4.018/t/10connect.t
DBD-mysql-4.018/t/20createdrop.t
DBD-mysql-4.018/t/25lockunlock.t
DBD-mysql-4.018/t/29warnings.t
DBD-mysql-4.018/t/30insertfetch.t
DBD-mysql-4.018/t/31insertid.t
DBD-mysql-4.018/t/32insert_error.t
DBD-mysql-4.018/t/35limit.t
DBD-mysql-4.018/t/35prepare.t
DBD-mysql-4.018/t/40bindparam.t
DBD-mysql-4.018/t/40bindparam2.t
DBD-mysql-4.018/t/40blobs.t
DBD-mysql-4.018/t/40catalog.t
DBD-mysql-4.018/t/40keyinfo.t
DBD-mysql-4.018/t/40listfields.t
DBD-mysql-4.018/t/40nulls.t
DBD-mysql-4.018/t/40nulls_prepare.t
DBD-mysql-4.018/t/40numrows.t
DBD-mysql-4.018/t/40server_prepare.t
DBD-mysql-4.018/t/40server_prepare_error.t
DBD-mysql-4.018/t/40types.t
DBD-mysql-4.018/t/41bindparam.t
DBD-mysql-4.018/t/41blobs_prepare.t
DBD-mysql-4.018/t/42bindparam.t
DBD-mysql-4.018/t/50chopblanks.t
DBD-mysql-4.018/t/50commit.t
DBD-mysql-4.018/t/51bind_type_guessing.t
DBD-mysql-4.018/t/52comment.t
DBD-mysql-4.018/t/53comment.t
DBD-mysql-4.018/t/55utf8.t
DBD-mysql-4.018/t/60leaks.t
DBD-mysql-4.018/t/65types.t
DBD-mysql-4.018/t/70takeimp.t
DBD-mysql-4.018/t/71impdata.t
DBD-mysql-4.018/t/75supported_sql.t
DBD-mysql-4.018/t/76multi_statement.t
DBD-mysql-4.018/t/80procs.t
DBD-mysql-4.018/t/85init_command.t
DBD-mysql-4.018/t/86_bug_36972.t
DBD-mysql-4.018/t/lib.pl
DBD-mysql-4.018/t/mem_leak.pl
DBD-mysql-4.018/t/mysql.dbtest
DBD-mysql-4.018/t/mysql.mtest
DBD-mysql-4.018/TODO
[root@Slave02 ~]# cd DBD-mysql-4.018
[root@Slave02 DBD-mysql-4.018]# perl Makefile.PL --mysql_config=/usr/local/mysql/bin/mysql_config 


PLEASE NOTE:

For 'make test' to run properly, you must ensure that the 
database user 'root' 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 'root'@'localhost' identified by 's3kr1t';

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

perl Makefile.PL --testuser=username

I will use the following settings for compiling and testing:

  cflags        (mysql_config) = -I/usr/local/mysql/include  -g
  embedded      (mysql_config) = 
  libs          (mysql_config) = -L/usr/local/mysql/lib -lmysqlclient -lpthread -lz -lm -lrt -lssl -lcrypto -ldl
  mysql_config  (Users choice) = /usr/local/mysql/bin/mysql_config
  nocatchstderr (default     ) = 0
  nofoundrows   (default     ) = 0
  ssl           (guessed     ) = 1
  testdb        (default     ) = test
  testhost      (default     ) = 
  testpassword  (default     ) = 
  testsocket    (default     ) = 
  testuser      (guessed     ) = root

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

Checking if your kit is complete...
Looks good
Multiple copies of Driver.xst found in: /usr/lib/perl5/site_perl/5.8.8/i386-linux-thread-multi/auto/DBI/ /usr/lib/perl5/vendor_perl/5.8.8/i386-linux-thread-multi/auto/DBI/ at Makefile.PL line 907
Using DBI 1.623 (for perl 5.008008 on i386-linux-thread-multi) installed in /usr/lib/perl5/site_perl/5.8.8/i386-linux-thread-multi/auto/DBI/
Writing Makefile for DBD::mysql
Writing MYMETA.yml and MYMETA.json
[root@Slave02 DBD-mysql-4.018]# make 
cp lib/DBD/mysql.pm blib/lib/DBD/mysql.pm
cp lib/DBD/mysql/GetInfo.pm blib/lib/DBD/mysql/GetInfo.pm
cp lib/DBD/mysql/INSTALL.pod blib/lib/DBD/mysql/INSTALL.pod
cp lib/Bundle/DBD/mysql.pm blib/lib/Bundle/DBD/mysql.pm
gcc -c  -I/usr/lib/perl5/site_perl/5.8.8/i386-linux-thread-multi/auto/DBI -I/usr/local/mysql/include  -g -DDBD_MYSQL_WITH_SSL -DDBD_MYSQL_INSERT_ID_IS_GOOD -g  -D_REENTRANT -D_GNU_SOURCE -fno-strict-aliasing -pipe -Wdeclaration-after-statement -I/usr/local/include -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -I/usr/include/gdbm -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 -m32 -march=i386 -mtune=generic -fasynchronous-unwind-tables   -DVERSION=\"4.018\" -DXS_VERSION=\"4.018\" -fPIC "-I/usr/lib/perl5/5.8.8/i386-linux-thread-multi/CORE"   dbdimp.c
dbdimp.c: In function 鈉ount_params?
dbdimp.c:94: warning: suggest parentheses around assignment used as truth value
dbdimp.c:137: warning: suggest parentheses around assignment used as truth value
dbdimp.c: In function 鈊bd_discon_all?
dbdimp.c:2172: warning: unused variable 鈏mp_xxh?
dbdimp.c: In function 鈓ysql_st_prepare?
dbdimp.c:2593: warning: unused variable 鈒imit_flag?
/usr/bin/perl -p -e "s/~DRIVER~/mysql/g" /usr/lib/perl5/site_perl/5.8.8/i386-linux-thread-multi/auto/DBI/Driver.xst > mysql.xsi
/usr/bin/perl /usr/lib/perl5/5.8.8/ExtUtils/xsubpp  -typemap /usr/lib/perl5/5.8.8/ExtUtils/typemap  mysql.xs > mysql.xsc && mv mysql.xsc mysql.c
Warning: duplicate function definition 'do' detected in mysql.xs, line 225
Warning: duplicate function definition 'rows' detected in mysql.xs, line 650
gcc -c  -I/usr/lib/perl5/site_perl/5.8.8/i386-linux-thread-multi/auto/DBI -I/usr/local/mysql/include  -g -DDBD_MYSQL_WITH_SSL -DDBD_MYSQL_INSERT_ID_IS_GOOD -g  -D_REENTRANT -D_GNU_SOURCE -fno-strict-aliasing -pipe -Wdeclaration-after-statement -I/usr/local/include -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -I/usr/include/gdbm -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 -m32 -march=i386 -mtune=generic -fasynchronous-unwind-tables   -DVERSION=\"4.018\" -DXS_VERSION=\"4.018\" -fPIC "-I/usr/lib/perl5/5.8.8/i386-linux-thread-multi/CORE"   mysql.c
mysql.xs: In function 釾S_DBD__mysql__db_do?
mysql.xs:242: warning: unused variable 鈙tatement_ptr?
mysql.xs: In function 釾S_DBD__mysql__st_more_results?
mysql.xs:588: warning: implicit declaration of function 鈓ysql_st_next_results?
mysql.xs:587: warning: unused variable 鈘etval?
mysql.xs: In function 釾S_DBD__mysql__GetInfo_dbd_mysql_get_info?
mysql.xs:724: warning: implicit declaration of function 鈏s_prefix?
Running Mkbootstrap for DBD::mysql ()
chmod 644 mysql.bs
rm -f blib/arch/auto/DBD/mysql/mysql.so
LD_RUN_PATH="/usr/local/mysql/lib:/lib" /usr/bin/perl myld gcc  -shared -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 -m32 -march=i386 -mtune=generic -fasynchronous-unwind-tables -L/usr/local/lib dbdimp.o mysql.o  -o blib/arch/auto/DBD/mysql/mysql.so        \
           -L/usr/local/mysql/lib -lmysqlclient -lpthread -lz -lm -lrt -lssl -lcrypto -ldl      \
          
chmod 755 blib/arch/auto/DBD/mysql/mysql.so
cp mysql.bs blib/arch/auto/DBD/mysql/mysql.bs
chmod 644 blib/arch/auto/DBD/mysql/mysql.bs
Manifying blib/man3/DBD::mysql.3pm
Manifying blib/man3/DBD::mysql::INSTALL.3pm
Manifying blib/man3/Bundle::DBD::mysql.3pm
[root@Slave02 DBD-mysql-4.018]# make install
Files found in blib/arch: installing files in blib/lib into architecture dependent library tree
Installing /usr/lib/perl5/site_perl/5.8.8/i386-linux-thread-multi/auto/DBD/mysql/mysql.so
Installing /usr/lib/perl5/site_perl/5.8.8/i386-linux-thread-multi/auto/DBD/mysql/mysql.bs
Installing /usr/lib/perl5/site_perl/5.8.8/i386-linux-thread-multi/Bundle/DBD/mysql.pm
Installing /usr/lib/perl5/site_perl/5.8.8/i386-linux-thread-multi/DBD/mysql.pm
Installing /usr/lib/perl5/site_perl/5.8.8/i386-linux-thread-multi/DBD/mysql/INSTALL.pod
Installing /usr/lib/perl5/site_perl/5.8.8/i386-linux-thread-multi/DBD/mysql/GetInfo.pm
Installing /usr/share/man/man3/Bundle::DBD::mysql.3pm
Installing /usr/share/man/man3/DBD::mysql.3pm
Installing /usr/share/man/man3/DBD::mysql::INSTALL.3pm
Appending installation info to /usr/lib/perl5/5.8.8/i386-linux-thread-multi/perllocal.pod
[root@Slave02 DBD-mysql-4.018]#