Install PERL cpan DBD: mysql error notes

Source: Internet
Author: User
Tags install perl

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

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.