📄 dbd::mysql::install.3
字号:
.\" Automatically generated by Pod::Man 2.16 (Pod::Simple 3.05).\".\" Standard preamble:.\" ========================================================================.de Sh \" Subsection heading.br.if t .Sp.ne 5.PP\fB\\$1\fR.PP...de Sp \" Vertical space (when we can't use .PP).if t .sp .5v.if n .sp...de Vb \" Begin verbatim text.ft CW.nf.ne \\$1...de Ve \" End verbatim text.ft R.fi...\" Set up some character translations and predefined strings. \*(-- will.\" give an unbreakable dash, \*(PI will give pi, \*(L" will give a left.\" double quote, and \*(R" will give a right double quote. \*(C+ will.\" give a nicer C++. Capital omega is used to do unbreakable dashes and.\" therefore won't be available. \*(C` and \*(C' expand to `' in nroff,.\" nothing in troff, for use with C<>..tr \(*W-.ds C+ C\v'-.1v'\h'-1p'\s-2+\h'-1p'+\s0\v'.1v'\h'-1p'.ie n \{\. ds -- \(*W-. ds PI pi. if (\n(.H=4u)&(1m=24u) .ds -- \(*W\h'-12u'\(*W\h'-12u'-\" diablo 10 pitch. if (\n(.H=4u)&(1m=20u) .ds -- \(*W\h'-12u'\(*W\h'-8u'-\" diablo 12 pitch. ds L" "". ds R" "". ds C` "". ds C' ""'br\}.el\{\. ds -- \|\(em\|. ds PI \(*p. ds L" ``. ds R" '''br\}.\".\" Escape single quotes in literal strings from groff's Unicode transform..ie \n(.g .ds Aq \(aq.el .ds Aq '.\".\" If the F register is turned on, we'll generate index entries on stderr for.\" titles (.TH), headers (.SH), subsections (.Sh), items (.Ip), and index.\" entries marked with X<> in POD. Of course, you'll have to process the.\" output yourself in some meaningful fashion..ie \nF \{\. de IX. tm Index:\\$1\t\\n%\t"\\$2"... nr % 0. rr F.\}.el \{\. de IX...\}.\".\" Accent mark definitions (@(#)ms.acc 1.5 88/02/08 SMI; from UCB 4.2)..\" Fear. Run. Save yourself. No user-serviceable parts.. \" fudge factors for nroff and troff.if n \{\. ds #H 0. ds #V .8m. ds #F .3m. ds #[ \f1. ds #] \fP.\}.if t \{\. ds #H ((1u-(\\\\n(.fu%2u))*.13m). ds #V .6m. ds #F 0. ds #[ \&. ds #] \&.\}. \" simple accents for nroff and troff.if n \{\. ds ' \&. ds ` \&. ds ^ \&. ds , \&. ds ~ ~. ds /.\}.if t \{\. ds ' \\k:\h'-(\\n(.wu*8/10-\*(#H)'\'\h"|\\n:u". ds ` \\k:\h'-(\\n(.wu*8/10-\*(#H)'\`\h'|\\n:u'. ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'^\h'|\\n:u'. ds , \\k:\h'-(\\n(.wu*8/10)',\h'|\\n:u'. ds ~ \\k:\h'-(\\n(.wu-\*(#H-.1m)'~\h'|\\n:u'. ds / \\k:\h'-(\\n(.wu*8/10-\*(#H)'\z\(sl\h'|\\n:u'.\}. \" troff and (daisy-wheel) nroff accents.ds : \\k:\h'-(\\n(.wu*8/10-\*(#H+.1m+\*(#F)'\v'-\*(#V'\z.\h'.2m+\*(#F'.\h'|\\n:u'\v'\*(#V'.ds 8 \h'\*(#H'\(*b\h'-\*(#H'.ds o \\k:\h'-(\\n(.wu+\w'\(de'u-\*(#H)/2u'\v'-.3n'\*(#[\z\(de\v'.3n'\h'|\\n:u'\*(#].ds d- \h'\*(#H'\(pd\h'-\w'~'u'\v'-.25m'\f2\(hy\fP\v'.25m'\h'-\*(#H'.ds D- D\\k:\h'-\w'D'u'\v'-.11m'\z\(hy\v'.11m'\h'|\\n:u'.ds th \*(#[\v'.3m'\s+1I\s-1\v'-.3m'\h'-(\w'I'u*2/3)'\s-1o\s+1\*(#].ds Th \*(#[\s+2I\s-2\h'-\w'I'u*3/5'\v'-.3m'o\v'.3m'\*(#].ds ae a\h'-(\w'a'u*4/10)'e.ds Ae A\h'-(\w'A'u*4/10)'E. \" corrections for vroff.if v .ds ~ \\k:\h'-(\\n(.wu*9/10-\*(#H)'\s-2\u~\d\s+2\h'|\\n:u'.if v .ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'\v'-.4m'^\v'.4m'\h'|\\n:u'. \" for low resolution devices (crt and lpr).if \n(.H>23 .if \n(.V>19 \\{\. ds : e. ds 8 ss. ds o a. ds d- d\h'-1'\(ga. ds D- D\h'-1'\(hy. ds th \o'bp'. ds Th \o'LP'. ds ae ae. ds Ae AE.\}.rm #[ #] #H #V #F C.\" ========================================================================.\".IX Title "DBD::mysql::INSTALL 3".TH DBD::mysql::INSTALL 3 "2006-12-23" "perl v5.10.0" "User Contributed Perl Documentation".\" For nroff, turn off justification. Always turn off hyphenation; it makes.\" way too many mistakes in technical documents..if n .ad l.nh.SH "NAME"INSTALL \- How to install and configure DBD::mysql.SH "SYNOPSIS".IX Header "SYNOPSIS".Vb 4\& perl Makefile.PL [options]\& make\& make test\& make install.Ve.SH "DESCRIPTION".IX Header "DESCRIPTION"This document describes the installation and configuration ofDBD::mysql, the Perl \s-1DBI\s0 driver for the MySQL database. Beforereading on, make sure that you have the prerequisites available:Perl, MySQL and \s-1DBI\s0. For details see the separate section.\&\*(L"\s-1PREREQUISITES\s0\*(R"..PPDepending on your version of Perl, it might be possible touse a binary distribution of DBD::mysql. If possible, this isrecommended. Otherwise you need to install from the sources.If so, you will definitely need a C compiler. Installationfrom binaries and sources are both described in separatesections. \*(L"\s-1BINARY\s0 \s-1INSTALLATION\s0\*(R". \*(L"\s-1SOURCE\s0 \s-1INSTALLATION\s0\*(R"..PPFinally, if you encounter any problems, do not forget toread the section on known problems. \*(L"\s-1KNOWN\s0 \s-1PROBLEMS\s0\*(R". Ifthat doesn't help, you should look into the archive of themailing list \fBperl@lists.mysql.com\fR. Seehttp://www.mysql.com for archive locations. And if thatstill doesn't help, please post a question on this mailinglist..SH "PREREQUISITES".IX Header "PREREQUISITES".IP "Perl" 4.IX Item "Perl"Preferrably a version of Perl, that comes preconfigured withyour system. For example, all Linux and FreeBSD distributionscome with Perl. For Windows, ActivePerl is recommended, seehttp://www.activestate.com for details..IP "MySQL" 4.IX Item "MySQL"You need not install the actual MySQL database server, theclient files and the devlopment files are sufficient. Forexample, Fedora Core 4 Linux distribution comes with \s-1RPM\s0 files(using \s-1YUM\s0) \fBmysql.i386\fR and \fBmysql\-server.i386\fR (use \*(L"yum search\*(R" to find exact package names). These are sufficient, if the MySQL server is located on a foreign machine. You may also create clientfiles by compiling from the MySQL source distribution and using.Sp.Vb 1\& configure \-\-without\-server.Ve.SpIf you are using Windows and need to compile from sources(which is only the case if you are not using ActivePerl),then you must ensure that the header and library files areinstalled. This may require choosing a \*(L"Custom installation\*(R"and selecting the appropriate option when running theMySQL setup program..IP "\s-1DBI\s0" 4.IX Item "DBI"DBD::mysql is a \s-1DBI\s0 driver, hence you need \s-1DBI\s0. It is availablefrom the same source where you got the DBD::mysql distributionfrom..IP "C compiler" 4.IX Item "C compiler"A C compiler is only required, if you install from source. Inmost cases there are binary distributions of DBD::mysqlavailable. However, if you need a C compiler, make sure, thatit is the same C compiler that was used for compiling Perl andMySQL! Otherwise you will almost definitely encounter problemsbecause of differences in the underlying C runtime libraries..SpIn the worst case, this might mean to compile Perl and MySQLyourself. But believe me, experience shows that a lot of problemsare fixed this way..IP "Gzip libraries" 4.IX Item "Gzip libraries"Late versions of MySQL come with support for compression. Thusit \fBmay\fR be required that you have install an \s-1RPM\s0 package likelibz-devel, libgz-devel or something similar..SH "BINARY INSTALLATION".IX Header "BINARY INSTALLATION"Binary installation is possible in the most cases, dependingon your system. I give some examples:.Sh "Windows".IX Subsection "Windows"ActivePerl offers a \s-1PPM\s0 archive of DBD::mysql. All you need todo is typing.PP.Vb 3\& ppm\& install DBI\& install DBD\-mysql.Ve.PPThis will fetch the modules via \s-1HTTP\s0 and install them. If youneed to use a \s-1WWW\s0 proxy server, the environment variableHTTP_proxy must be set:.PP.Vb 4\& set HTTP_proxy=http://my.proxy.server:8000/\& ppm\& install DBI\& install DBD\-mysql.Ve.PPOf course you need to replace the host name \f(CW\*(C`my.proxy.server\*(C'\fRand the port number \f(CW8000\fR with your local values..PPIf the above procedure doesn't work, please upgrade to the latestversion of ActivePerl. Versions before build 623 are known tohave problems..PP\&\s-1PPM\s0 3 is said to miss DBD::mysql in the repository. Thus use of\&\s-1PPM\s0 3 is discouraged, in favour of \s-1PPM\s0 2. If you need to use\&\s-1PPM\s0 3, try.PP.Vb 5\& ppm\& rep add PPM2 http://ppm.activestate.com/PPMPackages/5.6plus/\& rep 2\& install DBI\& install DBD\-mysql.Ve.Sh "Red Hat Linux".IX Subsection "Red Hat Linux"As of version 7.1, Red Hat Linux comes with MySQL and DBD::mysql.You need to ensure that the following \s-1RPM\s0's are installed:.PP.Vb 3\& mysql\& perl\-DBI\& perl\-DBD\-MySQL.Ve.PPFor installation from source the following \s-1RPM\s0's are required.PP.Vb 2\& mysql\-devel\& libz\-devel.Ve.PPOptional are.PP.Vb 1\& mysql\-server.Ve.Sh "Fedora Core Linux".IX Subsection "Fedora Core Linux"As of version 3, Fedora Linux comes with MySQL and DBD::mysql.You need to ensure that the following \s-1RPM\s0's are installed:.PP.Vb 2\& mysql or mysql\-server\& perl\-DBD\-MySQL.Ve.PPFor installation from source the following \s-1RPM\s0's are required.PP.Vb 2\& mysql\-devel\& libz\-devel.Ve.PPPlease try.PP.Vb 1\& yum search mysql.Ve.PPTo see the exact names.PPNote: (important) \s-1FC\s0 3 comes with MySQL 3.x, and some people haveupgraded using MySQL RPMs for newer versions. If you do this, you must re-compile you DBD::mysql because your existing DBD::mysql will belinked against the old version of MySQL's client libs. \s-1CPAN\s0 has no way toknow or detect that you have upgraded MySQL..Sh "Other systems".IX Subsection "Other systems"In the case of Linux or FreeBSD distributions it is very likelythat all you need comes with your distribution, as in the caseof Red Hat Linux. I just cannot give you names, as I am not usingthese systems..PPPlease let me know if you find the files in your SuSE Linux, DebianLinux or FreeBSD distribution so that I can extend the above list..SH "SOURCE INSTALLATION".IX Header "SOURCE INSTALLATION"So you need to install from sources. If you are lucky, the Perlmodule \f(CW\*(C`CPAN\*(C'\fR will do all for you, thanks to the excellent workof Andreas Koenig. Otherwise you will need to do a manualinstallation. Some of you, in particular system administratorsof multiple sites, will choose automatic installation. All ofthese installation types have an own section. \*(L"\s-1CPAN\s0 installation\*(R".\&\*(L"Manual installation\*(R". \*(L"Configuration\*(R"..PPThe DBD::mysql Makefile.PL needs to know where to find your MySQLinstallation. This may be achieved using command line switches(see \*(L"Configuration\*(R") or automatically using the mysql_config binarywhich comes with most MySQL distributions. If your MySQL distributioncontains mysql_config the easiest method is to ensure this binaryis on your path..PPe.g..PP.Vb 2\& PATH=$PATH:/usr/local/mysql/bin\& export PATH.Ve.Sh "\s-1CPAN\s0 installation".IX Subsection "CPAN installation"Installation of DBD::mysql can be incredibly easy:.PP.Vb 2\& cpan\& install DBD::mysql.Ve.PPIf you are using the \s-1CPAN\s0 module for the first time, just answerthe questions by accepting the defaults which are fine in mostcases. If you are using an older version of Perl, you mightinstead need a.PP.Vb 2\& perl \-MCPAN \-e shell\& install DBD::mysql.Ve.PPIf you cannot get the \s-1CPAN\s0 module working, you might try manualinstallation. If installation with \s-1CPAN\s0 fails because the your localsettings have been guessed wrong, you need to ensure MySQL'smysql_config is on your path (see \*(L"\s-1SOURCE\s0 \s-1INSTALLATION\s0\*(R") oralternatively create a script called \f(CW\*(C`mysql_config\*(C'\fR. This isdescribed in more details later. \*(L"Configuration\*(R"..Sh "Manual installation".IX Subsection "Manual installation"For a manual installation you need to fetch the DBD::mysqlsource distribution. The latest version is always availablefrom.PP.Vb 1\& http://www.cpan.org/modules/by\-module/DBD/.Ve.PPThe name is typically something like.PP.Vb 1\& DBD\-mysql\-1.2216.tar.gz.Ve.PPThe archive needs to be extracted. On Windows you may use a toollike WinZip, on Unix you type.PP.Vb 1\& gzip \-cd DBD\-mysql\-1.2216.tar.gz | tar xf \-.Ve.PPThis will create a subdirectory DBD\-mysql\-1.2216. Enter thissubdirectory and type.PP.Vb 3\& perl Makefile.PL\& make\& make test.Ve.PP(On Windows you may need to replace \*(L"make\*(R" with \*(L"nmake\*(R" or\&\*(L"dmake\*(R".) If the tests seem to look fine, you may continue with.PP.Vb 1\& make install.Ve.PPIf the compilation (make) or tests fail, you might need toconfigure some settings..PPFor example you might choose a different database, the Ccompiler or the linker might need some flags. \*(L"Configuration\*(R".\&\*(L"Compiler flags\*(R". \*(L"Linker flags\*(R"..PPFor Windows/CygWin there is a special section below.\&\*(L"CygWin\*(R" in Windows..Sh "Configuration".IX Subsection "Configuration"The install script \*(L"Makefile.PL\*(R" can be configured via a lot ofswitches. All switches can be used on the command line. Forexample, the test database:.PP.Vb 1\& perl Makefile.PL \-\-testdb=<db>.Ve.PPIf you do not like configuring these switches on the commandline, you may alternatively create a script called \f(CW\*(C`mysql_config\*(C'\fR.This is described later on..PPAvailable switches are:.IP "testdb" 4.IX Item "testdb"Name of the test database, defaults to \fBtest\fR..IP "testuser" 4.IX Item "testuser"Name of the test user, defaults to empty. If the name is empty,then the currently logged in users name will be used..IP "testpassword" 4.IX Item "testpassword"Password of the test user, defaults to empty..IP "testhost" 4.IX Item "testhost"Host name or \s-1IP\s0 number of the test database; defaults to localhost..IP "testport" 4.IX Item "testport"Port number of the test database.IP "ps\-protcol=1 or 0" 4.IX Item "ps-protcol=1 or 0"Whether to run the test suite using server prepared statements or driveremulated prepared statemetns. ps\-protocol=1 means use server prepare,ps\-protocol=0 means driver emulated..IP "cflags" 4.IX Item "cflags"This is a list of flags that you want to give to the C compiler.The most important flag is the location of the MySQL header files.For example, on Red Hat Linux the header files are in /usr/include/mysqland you might try.Sp
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -