用于查询数据库的perl脚本 [英] perl script to query database
问题描述
大家好,
我正在通过apache连接到从perl到mysql的数据库。 Apache配置正确。
Mysql用户名为root,密码为mysql1,数据库名称为test。
当我输入url 127.0时
.0.1 / cgi-bin / dbconn.pl,它显示内部服务器错误500.以及apache部分a)中的错误和访问错误。样本表是在测试中创建的,驻留在mysql数据库中。
尝试三重检查,配置看起来很好。有人可以帮忙吗?在此先感谢
Andrew
dbconn.pl
Hi All,
I am doing a connection to database from perl to mysql via apache. Apache is configured correctly.
Mysql username is root and password is mysql1, and database name is test.
when I type in url 127.0.0.1/cgi-bin/dbconn.pl, it showed internal server error 500. And errors in apache section a) below and errors in access. The samples table is created under test, residing in mysql database.
Tried to triple check and the configurations looks fine. Anyone can kindly assist? Thanks in advance
Andrew
dbconn.pl
推荐答案
在尝试将任何内容打印到屏幕之前,您需要打印标题。将这行代码添加到您的脚本中。
You will need to print the headers before you try and print anything to the screen. Add this line of code to your script.
这是链接到一个资源,以帮助确定一些当你遇到可怕的500错误时常见的问题。
- 凯文
Here is a link to a resource to help determining some of the common problems when you get the dreaded 500 error.
--Kevin
嗨凯文,
再次感谢。将尝试你提到的...
我使用的链接http://perl.about.com/od/perltutorials/a/perlmysql_3.htm
干杯......
Andrew
Hi Kevin,
Thanks again. Will try out what you mentioned...
I was using this link http://perl.about.com/od/perltutorials/a/perlmysql_3.htm
Cheers...
Andrew
这篇关于用于查询数据库的perl脚本的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!