Start to use the: cpan DBD: mysql command to install this module
Because it is the compiled SQL version, it has been modified in/etc/profile: export PATH =/usr/local/mysql/bin: $ PATH
The mysql lib file cannot be found.
The following error is reported:
# Tried to use 'dbd: mysql '.
# Error: Can't load '/root /. cpan/build/DBD-mysql-4.022/blib/arch/auto/DBD/mysql. so 'for module DBD: mysql: libmysqlclient. so.16: Unable to open shared object file: No file or directory at/usr/lib64/perl5/5.8.8/x86_64-linux-thread-multi/DynaLoader. pm line 230.
# At (eval 6) line 2
# Compilation failed in require at (eval 6) line 2.
# BEGIN failed -- compilation aborted at t/00base. t line 21.
FAILED -- Further testing stopped: Unable to load DBD: mysql
Make: *** [test_dynamic] Error 9
/Usr/bin/make test -- NOT OK
Running make install
Make test had returned bad status, won't install without force
[Root @ localhost dbdata_backup] # perl-MCPAN-e shell
Terminal does not support AddHistory.
Cpan shell -- CPAN registration and modules installation (v1.7602)
ReadLine support available (try 'Install Bundle: cpany ')
Solution:
Shell> perl-MCPAN-e shell
Cpan> install DBI
Cpan> install DBD: mysql is successfully installed.
Install DBD manually:
Note the mysql environment variables. If not, add/usr/local/mysql/bin to the environment variable PATH.
PATH =/usr/local/mysql/bin: $ PATH;
Export PATH (mysql installation PATH is set based on actual conditions)
Wget http://cpan.perl.org/modules/by-module/DBI/DBI-1.601.tar.gz
Tar-zxvf DBD-mysql-4.006.tar.gz
Cd DBD-mysql-4.006
Perl Makefile. PL-mysql_config =/usr/local/mysql/bin/mysql_config
Make
Make test
Make install