⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 install.pod

📁 视频监控网络部分的协议ddns,的模块的实现代码,请大家大胆指正.
💻 POD
📖 第 1 页 / 共 2 页
字号:
=head1 NAMEINSTALL - How to install and configure DBD::mysql=head1 SYNOPSIS  perl Makefile.PL [options]  make  make test  make install=head1 DESCRIPTIONThis document describes the installation and configuration ofDBD::mysql, the Perl DBI driver for the MySQL database. Beforereading on, make sure that you have the prerequisites available:Perl, MySQL and DBI. For details see the separate section.L</PREREQUISITES>.Depending 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<BINARY INSTALLATION>. L<SOURCE INSTALLATION>.Finally, if you encounter any problems, do not forget toread the section on known problems. L<KNOWN PROBLEMS>. Ifthat doesn't help, you should look into the archive of themailing list B<perl@lists.mysql.com>. Seehttp://www.mysql.com for archive locations. And if thatstill doesn't help, please post a question on this mailinglist.=head1 PREREQUISITES=over=item PerlPreferrably 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.=item MySQLYou need not install the actual MySQL database server, theclient files and the devlopment files are sufficient. Forexample, Fedora Core 4 Linux distribution comes with RPM files(using YUM) B<mysql.i386> and B<mysql-server.i386> (use "yum search" 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  configure --without-serverIf 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 "Custom installation"and selecting the appropriate option when running theMySQL setup program.=item DBIDBD::mysql is a DBI driver, hence you need DBI. It is availablefrom the same source where you got the DBD::mysql distributionfrom.=item C compilerA 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.In the worst case, this might mean to compile Perl and MySQLyourself. But believe me, experience shows that a lot of problemsare fixed this way.=item Gzip librariesLate versions of MySQL come with support for compression. Thusit B<may> be required that you have install an RPM package likelibz-devel, libgz-devel or something similar.=back=head1 BINARY INSTALLATIONBinary installation is possible in the most cases, dependingon your system. I give some examples:=head2 WindowsActivePerl offers a PPM archive of DBD::mysql. All you need todo is typing  ppm  install DBI  install DBD-mysqlThis will fetch the modules via HTTP and install them. If youneed to use a WWW proxy server, the environment variableHTTP_proxy must be set:  set HTTP_proxy=http://my.proxy.server:8000/  ppm  install DBI  install DBD-mysqlOf course you need to replace the host name C<my.proxy.server>and the port number C<8000> with your local values.If the above procedure doesn't work, please upgrade to the latestversion of ActivePerl. Versions before build 623 are known tohave problems.PPM 3 is said to miss DBD::mysql in the repository. Thus use ofPPM 3 is discouraged, in favour of PPM 2. If you need to usePPM 3, try  ppm  rep add PPM2 http://ppm.activestate.com/PPMPackages/5.6plus/  rep 2  install DBI  install DBD-mysql=head2 Red Hat LinuxAs of version 7.1, Red Hat Linux comes with MySQL and DBD::mysql.You need to ensure that the following RPM's are installed:  mysql  perl-DBI  perl-DBD-MySQLFor installation from source the following RPM's are required  mysql-devel  libz-develOptional are  mysql-server=head2 Fedora Core LinuxAs of version 3, Fedora Linux comes with MySQL and DBD::mysql.You need to ensure that the following RPM's are installed:  mysql or mysql-server  perl-DBD-MySQLFor installation from source the following RPM's are required  mysql-devel  libz-develPlease try   yum search mysqlTo see the exact namesNote: (important) FC 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. CPAN has no way toknow or detect that you have upgraded MySQL.=head2 Other systemsIn 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.Please let me know if you find the files in your SuSE Linux, DebianLinux or FreeBSD distribution so that I can extend the above list.=head1 SOURCE INSTALLATIONSo you need to install from sources. If you are lucky, the Perlmodule C<CPAN> 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</CPAN installation>.L</Manual installation>. L</Configuration>.The DBD::mysql Makefile.PL needs to know where to find your MySQLinstallation. This may be achieved using command line switches(see L</Configuration>) 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. e.g.  PATH=$PATH:/usr/local/mysql/bin  export PATH=head2 CPAN installationInstallation of DBD::mysql can be incredibly easy:  cpan  install DBD::mysqlIf you are using the CPAN 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  perl -MCPAN -e shell  install DBD::mysqlIf you cannot get the CPAN module working, you might try manualinstallation. If installation with CPAN fails because the your localsettings have been guessed wrong, you need to ensure MySQL'smysql_config is on your path (see L</SOURCE INSTALLATION>) oralternatively create a script called C<mysql_config>. This isdescribed in more details later. L</Configuration>.=head2 Manual installationFor a manual installation you need to fetch the DBD::mysqlsource distribution. The latest version is always availablefrom  http://www.cpan.org/modules/by-module/DBD/The name is typically something like  DBD-mysql-1.2216.tar.gzThe archive needs to be extracted. On Windows you may use a toollike WinZip, on Unix you type  gzip -cd DBD-mysql-1.2216.tar.gz | tar xf -This will create a subdirectory DBD-mysql-1.2216. Enter thissubdirectory and type  perl Makefile.PL  make  make test(On Windows you may need to replace "make" with "nmake" or"dmake".) If the tests seem to look fine, you may continue with  make installIf the compilation (make) or tests fail, you might need toconfigure some settings.For example you might choose a different database, the Ccompiler or the linker might need some flags. L</Configuration>.L</Compiler flags>. L</Linker flags>.For Windows/CygWin there is a special section below.L<Windows/CygWin>. =head2 ConfigurationThe install script "Makefile.PL" can be configured via a lot ofswitches. All switches can be used on the command line. Forexample, the test database:  perl Makefile.PL --testdb=<db>If you do not like configuring these switches on the commandline, you may alternatively create a script called C<mysql_config>.This is described later on.Available switches are:=over=item testdbName of the test database, defaults to B<test>.=item testuserName of the test user, defaults to empty. If the name is empty,then the currently logged in users name will be used.=item testpasswordPassword of the test user, defaults to empty.=item testhostHost name or IP number of the test database; defaults to localhost.=item testportPort number of the test database=item ps-protcol=1 or 0Whether 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.=item cflagsThis 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  -I/usr/include/mysqlOn Windows the header files may be in C:\mysql\include and you might try  -IC:\mysql\includeThe default flags are determined by running  mysql_config --cflagsMore details on the C compiler flags can be found in the followingsection. L</Compiler flags>.=item libsThis is a list of flags that you want to give to the linkeror loader. The most important flags are the locations and namesof additional libraries. For example, on Red Hat Linux yourMySQL client libraries are in /usr/lib/mysql and you might try  -L/usr/lib/mysql -lmysqlclient -lzOn Windows the libraries may be in C:\mysql\lib and  -LC:\mysql\lib -lmysqlclientmight be a good choice. The default flags are determined by running  mysql_config --libsMore details on the linker flags can be found in a separate section.L<Linker flags>.=backIf a switch is not present on the command line, then thescript C<mysql_config> will be executed. This script comesas part of the MySQL distribution. For example, to determinethe C compiler flags, we are executing  mysql_config --cflags  mysql_config --libsIf you want to configure your own settings for database name,database user and so on, then you have to create a script withthe same name, that replies  =head2 Compiler flagsNote: the folling info about compiler and linker flags, you shouldn't haveto use these options because Makefile.PL is pretty good at utilisingmysql_config to get the flags that you need for a successful compile.It is typically not so difficult to determine the appropriateflags for the C compiler. The linker flags, which you find inthe next section, are another story.The determination of the C compiler flags is usually left toa configuration script called F<mysql_config>, which can beinvoked with  mysql_config --cflagsWhen doing so, it will emit a line with suggested C compilerflags, for example like this:  -L/usr/include/mysqlThe C compiler must find some header files. Header files havethe extension C<.h>. MySQL header files are, for example,F<mysql.h> and F<mysql_version.h>. In most cases the headerfiles are not installed by default. For example, on Windows

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -