Install SQL-related modules in Perl on Mac OS-Based on DBI and DBD: Sybase

Source: Internet
Author: User
Tags sybase install perl

Mac OSLowerPerlLinkSQLInstallation of related modules(Notes)

--Based onDBIAndDBD: Sybase

Preface:

This article is a supplement to <Perl connected to SQL>. It mainly explains how to install Perl DBI and DBD modules in Mac OS.

This article is based on <installation methods for Perl modules on various platforms (for example, ing to SQL Server 2000 from Linux using Perl DBI. pdf.

 

Prerequisites:

Based on the <various block installation methods (transfer)>, We can summarize the differences in the Perl Compiler (Perl core or ActivePerl) in the Mac OS environment. There are three installation methods in total.

1. Install Perl core locally, that is, download the required DBI and DBD Module source files and install them locally.

2. Install Perl core on the network, that is, use the perl-mcpan command to automatically install it from the network.

3. ActivePerl uses its ppm tool to install it directly from the network.

 

Method 2 the ftp port needs to be opened for direct network installation and can only be configured according to the default config during installation, therefore, the installation was not successful on the Mac (failed to download the source file and the configuration during installation does not conform to the local environment ).

 

Method 3 DBI and DBD related modules are successfully installed, but an error occurs during use. the reason for consideration is that PPM installation is a direct copy of Executable documents, and the module provided on the network may not be compatible with the CPU architecture of Apple machines.

 

The following describes how to use method 1.

 

Specific process:

1.Install the required compilation tools GCC and make

If GCC and make are not installed locally, you cannot install the relevant module by compiling the source code. Similarly, method 2 is automatically installed, but also based on a local compilation tool.

There are two ways to obtain GCC and make for Mac OS. One is obtained through the apple developer website, and the other is obtained from the Mac OS installation disc.

Install GCC and developer tools from the xtools folder on the first CD.

2.Install the DBI and DBD modules.

For more information about the following installation, see <connecting to SQL Server 2000 from Linux using Perl DBI. pdf>.

DBI compilation fails:

Execute Perl makefile. if an error is reported during make after PL, it means that the relevant file cannot be found. the reason is that the dynamic Connection Library Mac OS required for DBI compilation is not provided. You can choose static compilation during compilation. that is, Perl makefile. PL static.

After compilation and installation, the required library files will be created in the system. at this time, we strongly recommend that you re-compile DBI according to the data method, that is, do not select static When configuring. otherwise, unexpected problems may occur in future operations.

Set the importance of environment variables before installing DBD-SYBASE:

Before installing DBD, you must set the following environment variables and ensure that they are actually set.

Sybase =/usr/local/freetds

LD_LIBRARY_PATH =$ {LD_LIBRARY_PATH}:/usr/local/freetds/lib

<End>

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.