![]() |
|
首页 │ Apache │ Linux│ Java│ MySQL│ 注册│帮助 | |||
WINDOWNS下安装:
DBI-MYSQL下载
http://www.mysql.com/downloads/contrib.html
安装过程:用ppm
ppm> install DBI
ppm> install DBD-MySQL
unix下安装:
perl安装的默认路径:
/usr/local/apache/cgi-bin/
无须配置perl即可运行,必有语句:
#!/usr/bin/perl
print "content-type:text/html","\n\n";
安装DBI
shell> perl -MCPAN -e shell
cpan> install DBI
cpan> install DBD::mysql
The 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 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:
Unpack the distribution into the current directory:
shell> gunzip < DBI-VERSION.tar.gz | tar xvf -
This command creates a directory named DBI-VERSION.
Change location into the top-level directory of the unpacked distribution:
shell> cd DBI-VERSION
Build the distribution and compile everything:
shell> perl Makefile.PL
shell> make
shell> make test
shell> 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 fails.
或者直接用port安装:
shell >cd /usr/ports/databases/p5-DBI/
shell >make install
shell >/usr/ports/databases/p5-DBD-mysql/
shell >make install
由于mysql5和以前版本的算法不同,所以
update mysql.user set password = old_password('newpwd')
where host = 'localhost' and user = 'root';
然后flush priviledges;

