Software: Apache/2.2.3 (CentOS). PHP/5.1.6 uname -a: Linux mx-ll-110-164-51-230.static.3bb.co.th 2.6.18-194.el5PAE #1 SMP Fri Apr 2 15:37:44 uid=48(apache) gid=48(apache) groups=48(apache) Safe-mode: OFF (not secure) /usr/share/doc/perl-DBD-MySQL-3.0007/ drwxr-xr-x |
Viewing file: INSTALL.html (27.36 KB) -rw-r--r-- Select action/file-type: (+) | (+) | (+) | Code (+) | Session (+) | (+) | SDB (+) | (+) | (+) | (+) | (+) | (+) |
NAMEINSTALL - How to install and configure DBD::mysql
SYNOPSISperl Makefile.PL [options] make make test make install
DESCRIPTIONThis document describes the installation and configuration of DBD::mysql, the Perl DBI driver for the MySQL database. Before reading on, make sure that you have the prerequisites available: Perl, MySQL and DBI. For details see the separate section. PREREQUISITES. Depending on your version of Perl, it might be possible to use a binary distribution of DBD::mysql. If possible, this is recommended. Otherwise you need to install from the sources. If so, you will definitely need a C compiler. Installation from binaries and sources are both described in separate sections. BINARY INSTALLATION. SOURCE INSTALLATION. Finally, if you encounter any problems, do not forget to read the section on known problems. KNOWN PROBLEMS. If that doesn't help, you should look into the archive of the mailing list perl@lists.mysql.com. See http://www.mysql.com for archive locations. And if that still doesn't help, please post a question on this mailing list.
PREREQUISITES
BINARY INSTALLATIONBinary installation is possible in the most cases, depending on your system. I give some examples:
WindowsActivePerl offers a PPM archive of DBD::mysql. All you need to do is typing ppm install DBI install DBD-mysql This will fetch the modules via HTTP and install them. If you need to use a WWW proxy server, the environment variable HTTP_proxy must be set: set HTTP_proxy=http://my.proxy.server:8000/ ppm install DBI install DBD-mysql Of course you need to replace the host name If the above procedure doesn't work, please upgrade to the latest version of ActivePerl. Versions before build 623 are known to have problems. PPM 3 is said to miss DBD::mysql in the repository. Thus use of PPM 3 is discouraged, in favour of PPM 2. If you need to use PPM 3, try ppm rep add PPM2 http://ppm.activestate.com/PPMPackages/5.6plus/ rep 2 install DBI install DBD-mysql
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-MySQL For installation from source the following RPM's are required mysql-devel libz-devel Optional are mysql-server
Other systemsIn the case of Linux or FreeBSD distributions it is very likely that all you need comes with your distribution, as in the case of Red Hat Linux. I just cannot give you names, as I am not using these systems. Please let me know if you find the files in your SuSE Linux, Debian Linux or FreeBSD distribution so that I can extend the above list.
SOURCE INSTALLATIONSo you need to install from sources. If you are lucky, the Perl
module The DBD::mysql Makefile.PL needs to know where to find your MySQL installation. This may be achieved using command line switches (see Configuration) or automatically using the mysql_config binary which comes with most MySQL distributions. If your MySQL distribution contains mysql_config the easiest method is to ensure this binary is on your path. e.g. PATH=$PATH:/usr/local/mysql/bin export PATH
CPAN installationInstallation of DBD::mysql can be incredibly easy: cpan install DBD::mysql If you are using the CPAN module for the first time, just answer the questions by accepting the defaults which are fine in most cases. If you are using an older version of Perl, you might instead need a perl -MCPAN -e shell install DBD::mysql If you cannot get the CPAN module working, you might try manual
installation. If installation with CPAN fails because the your local
settings have been guessed wrong, you need to ensure MySQL's
mysql_config is on your path (see SOURCE INSTALLATION) or
alternatively create a script called
Manual installationFor a manual installation you need to fetch the DBD::mysql source distribution. The latest version is always available from http://www.cpan.org/modules/by-module/DBD/ The name is typically something like DBD-mysql-1.2216.tar.gz The archive needs to be extracted. On Windows you may use a tool like 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 this subdirectory 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 install If the make or tests fail, you might need to configure some settings. For example you might choose a different database, the C compiler or the linker might need some flags. Configuration. Compiler flags. Linker flags. For Windows/CygWin there is a special section below. Windows/CygWin.
ConfigurationThe install script ``Makefile.PL'' can be configured via a lot of switches. All switches can be used on the command line. For example, the test database: perl Makefile.PL --testdb=<db> If you do not like configuring these switches on the command
line, you may alternatively create a script called Available switches are:
If a switch is not present on the command line, then the
script mysql_config --cflags mysql_config --libs If you want to configure your own settings for database name, database user and so on, then you have to create a script with the same name, that replies =head2 Compiler flags It is typically not so difficult to determine the appropriate flags for the C compiler. The linker flags, which you find in the next section, are another story. The determination of the C compiler flags is usually left to a configuration script called mysql_config, which can be invoked with mysql_config --cflags When doing so, it will emit a line with suggested C compiler flags, for example like this: -L/usr/include/mysql The C compiler must find some header files. Header files have
the extension If you know the location of the header files, then you will need to add an option -L<header directory> to the C compiler flags, for example
Linker flagsAppropriate linker flags are the most common source of problems while installing DBD::mysql. I will only give a rough overview, you'll find more details in the troubleshooting section. KNOWN PROBLEMS The determination of the C compiler flags is usually left to a configuration script called mysql_config, which can be invoked with mysql_config --libs When doing so, it will emit a line with suggested C compiler flags, for example like this: -L'/usr/lib/mysql' -lmysqlclient -lnsl -lm -lz -lcrypt The following items typically need to be configured for the linker:
SPECIAL SYSTEMSBelow you find information on particular systems:
Windows/CygWinIf you are a user of Cygwin (the Redhat distribution) you already know, it contains a nicely running perl 5.6.1, installation of additional modules usually works as a charme via the standard procedure of perl makefile.PL make make test make install The Windows binary distribution of MySQL runs smoothly under Cygwin. You can start/stop the server and use all Windows clients without problem. But to install DBD::mysql you have to take a little special action. Don't attempt to build DBD::mysql against either the MySQL Windows or Linux/Unix BINARY distributions: neither will work! You MUST compile the MySQL clients yourself under Cygwin, to get a 'libmysqlclient.a' compiled under Cygwin. Really! You'll only need that library and the header files, you don't need any other client parts. Continue to use the Windows binaries. And don't attempt (currently) to build the MySQL Server part, it is unneccessary, as MySQL AB does an excellent job to deliver optimized binaries for the mainstream operating systems, and it is told, that the server compiled under Cygwin is unstable. Install MySQL (if you havn't already)
Build MySQL clients under Cygwin:
Please note, in my environment the 'mysql' client did not accept a simple RETURN, I had to use CTRL-RETURN to send commands ... strange, but I didn't attempt to fix that, as we are only interested in the built lib and headers. At the 'mysql>' prompt do a quick check: mysql> use mysql mysql> show tables; mysql> select * from db; mysql> exit You are now ready to build DBD::mysql! Build DBD::mysql:
Notes: This was tested with MySQL version 3.23.54a and DBD::mysql version 2.1022. I patched the above mentioned test scripts and sent the patches to the author of DBD::mysql Jochen Wiedman. Georg Rehfeld 15. Jan. 2003
KNOWN PROBLEMS
LD_RUN_PATH="/usr/lib/mysql:/lib:/usr/lib" gcc -o blib/arch/auto/DBD/mysql/mysql.so -shared -L/usr/local/lib dbdimp.o mysql.o -L/usr/lib/mysql -lmysqlclient -lm -L/usr/lib/gcc-lib/i386-redhat-linux/2.96 -lgcc -lz /usr/bin/ld: cannot find -lz collect2: ld returned 1 exit status make: *** [blib/arch/auto/DBD/mysql/mysql.so] Error 1 If this is the case for you, install an RPM archive like libz-devel, libgz-devel, zlib-devel or gzlib-devel or something similar. 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: _umoddi3 at /usr/local/perl-5.005/lib/5.005/i586-linux-thread/DynaLoader.pm line 168. This means, that your linker doesn't include libgcc.a. You have the following options: The solution is telling the linker to use libgcc. Run gcc --print-libgcc-file to determine the exact location of libgcc.a or for older versions of gcc gcc -v to determine the directory. If you know the directory, add a -L<directory> -lgcc to the list of C compiler flags. Configuration. Linker flags. install_driver(mysql) failed: Can't load '/usr/lib/perl5/site_perl/i586-linux/auto/DBD/mysql/mysql.so' for module DBD::mysql: File not found at /usr/lib/perl5/i586-linux/5.00404/DynaLoader.pm line 166 then this error message can be misleading: It's not mysql.so that fails being loaded, but libmysqlclient.so! The usual problem is that this file is located in a directory like /usr/lib/mysql where the linker doesn't look for it. The best workaround is using a statically linked mysqlclient library, for example /usr/lib/mysql/libmysqlclient.a The use of a statically linked library is described in the previous section on linker flags. Configuration. Linker flags.
SUPPORTFinally, if everything else fails, you are not alone. First of all, for an immediate answer, you should look into the archives of the mailing list perl@lists.mysql.com. See http://www.mysql.com for archive locations. If you don't find an appropriate posting and reply in the mailing list, please post a question. Typically a reply will be seen within one or two days. |
:: Command execute :: | |
:: Shadow's tricks :D :: | |
Useful Commands
|
:: Preddy's tricks :D :: | |
Php Safe-Mode Bypass (Read Files)
|
--[ c999shell v. 1.0 pre-release build #16 Modded by Shadow & Preddy | RootShell Security Group | r57 c99 shell | Generation time: 0.0098 ]-- |