MySqlTalk.com  

Go Back   MySqlTalk.com > MySQL > Documentation
User Name
Password
FAQ Members List Calendar Search Today's Posts Mark Forums Read


Reply
 
Thread Tools Search this Thread
Old 06-09-2004, 02:51 AM   #101
Administrator
Administrator
 
Join Date: Jun 2004
Posts: 383 Administrator is on a distinguished road
2.7 Perl Installation Notes

From http://dev.mysql.com/doc/mysql/en/Perl_support.html

2.7 Perl Installation Notes



Perl support for MySQL is provided by means of the DBI/DBD client interface. The interface requires Perl Version 5.6.0 or later. It will not work if you have an older version of Perl.

If you want to use transactions with Perl DBI, you need to have DBD::mysql version 1.2216 or newer. Version 2.9003 or newer is recommended.

Note that if you are using MySQL 4.1 client library, you must use DBD::mysql 2.9003 or newer.

As of Version 3.22.8, Perl support is no longer included with MySQL distributions. You can obtain the necessary modules from http://search.cpan.org for Unix, or by using the ActiveState ppm program on Windows. The following sections describe how to do this.

Perl support for MySQL must be installed if you want to run the MySQL benchmark scripts. See section 7.1.4 The MySQL Benchmark Suite.
Administrator is offline   Fork this post Reply With Quote
Old 06-09-2004, 02:52 AM   #102
Administrator
Administrator
 
Join Date: Jun 2004
Posts: 383 Administrator is on a distinguished road
2.7.1 Installing Perl on Unix

From http://dev.mysql.com/doc/mysql/en/Pe...tallation.html

2.7.1 Installing Perl on Unix

MySQL Perl support requires that you've installed MySQL client programming support (libraries and header files). Most installation methods install the necessary files. However, if you installed MySQL from RPM files on Linux, be sure that you've installed the developer RPM. The client programs are in the client RPM, but client programming support is in the developer RPM.

If you want to install Perl support, the files you will need can be obtained from the CPAN (Comprehensive Perl Archive Network) at http://search.cpan.org.

The easiest way to install Perl modules on Unix is to use the CPAN module. For example:

shell> perl -MCPAN -e shellcpan> install DBIcpan> install DBD::mysqlThe DBD::mysql installation runs a number of tests. These tests require being able to connect to the local MySQL server as the anonymous user with no password. If you have removed anonymous accounts or assigned them passwords, the tests fail. You can use force install DBD::mysql to ignore the failed tests.

DBI requires the Data:umper module. It may already be installed; if not, you should install it before installing DBI.

It is also possible to download the module distributions in the form of compressed tar archives and build the modules manually. For example, to unpack and build a DBI distribution, use a procedure such as this:
  1. Unpack the distribution into the current directory: shell> gunzip < DBI-VERSION.tar.gz | tar xvf -This command creates a directory named `DBI-VERSION'.
  2. Change location into the top-level directory of the unpacked distribution: shell> cd DBI-VERSION
  3. Build the distribution and compile everything: shell> perl Makefile.PLshell> makeshell> make testshell> make install
The make test command is important because it verifies that the module is working. Note that when you run that command during the DBD::mysql installation to exercise the interface code, the MySQL server must be running or the test will fail.

It is a good idea to rebuild and reinstall the DBD::mysql distribution whenever you install a new release of MySQL, particularly if you notice symptoms such as that all your DBI scripts fail after you upgrade MySQL.

If you don't have access rights to install Perl modules in the system directory or if you want to install local Perl modules, the following reference may be useful: http://servers.digitaldaze.com/extensions/perl/modules.html#modules

Look under the heading ``Installing New Modules that Require Locally Installed Modules.''
Administrator is offline   Fork this post Reply With Quote
Old 06-09-2004, 02:52 AM   #103
Administrator
Administrator
 
Join Date: Jun 2004
Posts: 383 Administrator is on a distinguished road
2.7.2 Installing ActiveState Perl on Windows

From http://dev.mysql.com/doc/mysql/en/ActiveState_Perl.html

2.7.2 Installing ActiveState Perl on Windows



On Windows, you should do the following to install the MySQL DBD module with ActiveState Perl:
This procedure should work at least with ActiveState Perl Version 5.6.

If you can't get the procedure to work, you should instead install the MyODBC driver and connect to the MySQL server through ODBC:

use DBI;$dbh= DBI->connect("DBI:ODBC:$dsn",$user,$password) || die "Got error $DBI::errstr when connecting to $dsn\n";
Administrator is offline   Fork this post Reply With Quote
Old 06-09-2004, 02:53 AM   #104
Administrator
Administrator
 
Join Date: Jun 2004
Posts: 383 Administrator is on a distinguished road
2.7.3 Problems Using the Perl DBI/DBD Interface

From http://dev.mysql.com/doc/mysql/en/Pe..._problems.html

2.7.3 Problems Using the Perl DBI/DBD Interface



If Perl reports that it can't find the `../mysql/mysql.so' module, then the problem is probably that Perl can't locate the shared library `libmysqlclient.so'.

You should be able to fix this by one of the following methods:
  • Compile the DBD::mysql distribution with perl Makefile.PL -static -config rather than perl Makefile.PL.
  • Copy `libmysqlclient.so' to the directory where your other shared libraries are located (probably `/usr/lib' or `/lib').
  • Modify the -L options used to compile DBD::mysql to reflect the actual location of `libmysqlclient.so'.
  • On Linux, you can add the pathname of the directory where `libmysqlclient.so' is located to the `/etc/ld.so.conf' file.
  • Add the pathname of the directory where `libmysqlclient.so' is located to the LD_RUN_PATH environment variable. Some systems use LD_LIBRARY_PATH instead.
Note that you may also need to modify the -L options if there are other libraries that the linker fails to find. For example, if the linker cannot find libc because it is in `/lib' and the link command specifies -L/usr/lib, change the -L option to -L/lib or add -L/lib to the existing link command.

If you get the following errors from DBD::mysql, you are probably using gcc (or using an old binary compiled with gcc):

/usr/bin/perl: can't resolve symbol '__moddi3'/usr/bin/perl: can't resolve symbol '__divdi3'Add -L/usr/lib/gcc-lib/... -lgcc to the link command when the `mysql.so' library gets built (check the output from make for `mysql.so' when you compile the Perl client). The -L option should specify the pathname of the directory where `libgcc.a' is located on your system.

Another cause of this problem may be that Perl and MySQL aren't both compiled with gcc. In this case, you can solve the mismatch by compiling both with gcc.

You may see the following error from DBD::mysql when you run the tests:

t/00base............install_driver(mysql) failed:Can't load '../blib/arch/auto/DBD/mysql/mysql.so' for module DBD::mysql:../blib/arch/auto/DBD/mysql/mysql.so: undefined symbol:uncompress at /usr/lib/perl5/5.00503/i586-linux/DynaLoader.pm line 169.This means that you need to include the -lz compression library on the link line. That can be done by changing the following line in the file `lib/DBD/mysql/Install.pm':

$sysliblist .= " -lm";Change that line to:

$sysliblist .= " -lm -lz";After this, you must run make realclean and then proceed with the installation from the beginning.

If you want to install DBI on SCO, you have to edit the `Makefile' in DBI-xxx and each subdirectory.

Note that the following assumes gcc 2.95.2 or newer:

OLD: NEW:CC = cc CC = gccCCCDLFLAGS = -KPIC -W1,-Bexport CCCDLFLAGS = -fpicCCDLFLAGS = -wl,-Bexport CCDLFLAGS =LD = ld LD = gcc -G -fpicLDDLFLAGS = -G -L/usr/local/lib LDDLFLAGS = -L/usr/local/libLDFLAGS = -belf -L/usr/local/lib LDFLAGS = -L/usr/local/libLD = ld LD = gcc -G -fpicOPTIMISE = -Od OPTIMISE = -O1OLD:CCCFLAGS = -belf -dy -w0 -U M_XENIX -DPERL_SCO5 -I/usr/local/includeNEW:CCFLAGS = -U M_XENIX -DPERL_SCO5 -I/usr/local/includeThis is because the Perl dynaloader will not load the DBI modules if they were compiled with icc or cc.

If you want to use the Perl module on a system that doesn't support dynamic linking (like SCO), you can generate a static version of Perl that includes DBI and DBD::mysql. The way this works is that you generate a version of Perl with the DBI code linked in and install it on top of your current Perl. Then you use that to build a version of Perl that additionally has the DBD code linked in, and install that.

On SCO, you must have the following environment variables set:

LD_LIBRARY_PATH=/lib:/usr/lib:/usr/local/lib:/usr/progressive/libOr:

LD_LIBRARY_PATH=/usr/lib:/lib:/usr/local/lib:/usr/ccs/lib:\ /usr/progressive/lib:/usr/skunk/libLIBPATH=/usr/lib:/lib:/usr/local/lib:/usr/ccs/lib:\ /usr/progressive/lib:/usr/skunk/libMANPATH=scohelp:/usr/man:/usr/local1/man:/usr/local/man:\ /usr/skunk/man:First, create a Perl that includes a statically linked DBI module by running these commands in the directory where your DBI distribution is located:

shell> perl Makefile.PL -static -configshell> makeshell> make installshell> make perlThen you must install the new Perl. The output of make perl will indicate the exact make command you will need to execute to perform the installation. On SCO, this is make -f Makefile.aperl inst_perl MAP_TARGET=perl.

Next, use the just-created Perl to create another Perl that also includes a statically linked DBD::mysql by running these commands in the directory where your DBD::mysql distribution is located:

shell> perl Makefile.PL -static -configshell> makeshell> make installshell> make perlFinally, you should install this new Perl. Again, the output of make perl indicates the command to use.
Administrator is offline   Fork this post Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Import Access, Excel and data of other formats to MySQL by Navicat NavicatGuy Articles 0 08-17-2004 01:08 AM
3.2 Entering Queries Administrator Documentation 0 06-09-2004 02:58 AM
1.4.3.2 Using the MySQL Software for Free Under GPL Administrator Documentation 0 06-08-2004 02:20 AM
1.2.2 The Main Features of MySQL Administrator Documentation 0 06-08-2004 01:55 AM
1.2 Overview of the MySQL Database Management System Administrator Documentation 0 06-07-2004 10:11 PM



All times are GMT -4. The time now is 12:21 PM.



Powered by: vBulletin, Copyright ©2000 - 2008, Jelsoft Enterprises Limited.
Google
  Web http://www.mysqltalk.com
DISCLAIMERS:
1. We have no commercial interest in this site.
Banner Ads and Subscriptions will only be used to help pay for hosting and maintenance costs.
2. MySQLTalk.com is NOT affiliated with MySQL AB in any way.
3. MySQLTalk.com is NOT endorsed by MySQL AB in any way.
4. Please do not post any content that is harmful to MySQL or MySQL AB, meaning no misleading or obsolete information will be tolerated.
Well-founded constructive criticism meant to help the community is permitted.
5. This website is founded with the goal of improving the MySQL community.
We not only tolerate newbies, we encourage them.
Please do not ask newbies to "read the manual".