[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re[2]: [cobalt-users] Perl/CGI -> mySQL
- Subject: Re[2]: [cobalt-users] Perl/CGI -> mySQL
- From: Steve Hamilton <WebManager@xxxxxxxx>
- Date: Mon Jan 31 10:08:46 2000
Hello Paul,
Do you have a user account setup in mySQL for you HTTPD??
You may have an account setup as admin but you should have a user on
your mysql user tables called 'httpd' the host being 'localhost'
After you change it/add it remember to RELOAD or it will still not
work!
Steve Hamilton
Web Manager
inAlaska.com
Saturday, May 29, 1999, 6:23:36 AM, you wrote:
PS> Hi Richard,
PS> If it runs by hand & not through CGI, could it be possible that is a
PS> permissions problem -- do you need to chmod on your database files?
PS> Paul Senzee
PS> -----Original Message-----
PS> From: Richard E. Perlotto II <richard@xxxxxxxxxxxx>
PS> To: cobalt-users@xxxxxxxxxxxxxxx <cobalt-users@xxxxxxxxxxxxxxx>
PS> Date: Saturday, January 29, 2000 1:15 AM
PS> Subject: [cobalt-users] Perl/CGI -> mySQL
>>I am having a perplexing issue. I have a perl script that is trying
>>to access a mySQL database. If I run the perl code that accesses
>>the database by itself, it works, but if I run it through a CGI program
>>it does not. The code is identical between the two programs where the
>>database access is being attempted.
>>
>>I ran all the recommended tests from http://www.mysql.org to insure that
PS> the
>>database is accessible via the network, and it is. The tests were:
>>
>>mysqladmin -p version
>>mysqladmin -p variables
>>mysqladmin -p -h `hostname` version variables
>>mysqladmin -p -h `hostname` --port=3306 version
>>mysqladmin -p --socket=/var/lib/mysql/mysql.sock version
>>
>>I have even tried running a level 9 DBI trace as follows (and I know that
PS> there is a username
>>and password listed in the output):
>>
>> DBI dispatch debug level set to 9
>> dbih_setup_handle(DBI::dr=HASH(0x10197d10)=>DBI::dr=HASH(0x101e4494),
PS> DBD::mysql::dr, 0, Null!)
>> dbih_make_com(Null!, DBD::mysql::dr, 72)
>> >> connect DISPATCH (DBI::dr=HASH(0x10197d10) rc1/3 @5 g0
PS> a101be4b8)
>> -> connect for DBD::mysql::dr (DBI::dr=HASH(0x10197d10)~0x101e4494
PS> 'test_db' 'username' 'password' HASH(0x101309bc))
>> dbih_setup_handle(DBI::db=HASH(0x101e4524)=>DBI::db=HASH(0x101e44dc),
PS> DBD::mysql::db, 10197b60, Null!)
>> dbih_make_com(DBI::dr=HASH(0x101e4494), DBD::mysql::db, 416)
>>imp_dbh->connect: dsn = test_db, uid = username, pwd = password
>> ERROR EVENT 2002 'Can't connect to local MySQL server' (Handlers:
PS> undef)
>>Can't connect to local MySQL server error 2002 recorded: Can't connect to
PS> local MySQL server
>> >> DESTROY DISPATCH (DBI::db=HASH(0x101e4524) rc1/1 @1 g0 a0)
>> (outer handle DESTROY ignored)
>> >> DESTROY DISPATCH (DBI::db=HASH(0x101e44dc) rc1/1 @1 g0 a0)
>> -> DESTROY for DBD::mysql::db (DBI::db=HASH(0x101e44dc))
>> <- DESTROY= undef
>> dbih_clearcom (h 0x101e44dc, com 0x101df590):
>> FLAGS 0x11: COMSET Warn
>> TYPE 2
>> PARENT DBI::dr=HASH(0x101e4494)
>> KIDS 0 (0 active)
>> IMP_DATA undef in 'DBD::mysql::db'
>> dbih_clearcom 0x101e44dc (com 0x101df590, type 2) done.
>>
>> <- connect= undef
>> !! ERROR: 2002 'Can't connect to local MySQL server'
>> >> errstr DISPATCH (DBI::dr=HASH(0x10197d10) rc1/3 @1 g1
PS> a101bded8)
>> -> errstr in DBD::_::common for DBD::mysql::dr
PS> (DBI::dr=HASH(0x10197d10)~0x101e4494)
>> <- errstr= ( 'Can't connect to local MySQL server' ) [1 items]
>> >> disconnect_all DISPATCH (DBI::dr=HASH(0x10197d10) rc1/3 @1 g0
PS> a101bdc50)
>> -> disconnect_all for DBD::mysql::dr
PS> (DBI::dr=HASH(0x10197d10)~0x101e4494)
>> <- disconnect_all= ''
>> >> DESTROY DISPATCH (DBI::dr=HASH(0x101e4494) rc1/1 @1 g0 a0)
>> -> DESTROY in DBD::_::common for DBD::mysql::dr
PS> (DBI::dr=HASH(0x101e4494))
>> <- DESTROY= undef
>> dbih_clearcom (h 0x101e4494, com 0x101e0ca8):
>> FLAGS 0x215: COMSET Active Warn AutoCommit
>> TYPE 1
>> PARENT undef
>> KIDS 0 (0 active)
>> IMP_DATA undef in 'DBD::mysql::dr'
>> dbih_clearcom 0x101e4494 (com 0x101e0ca8, type 1) done.
>>
>> >> DESTROY DISPATCH (DBI::dr=HASH(0x10197d10) rc1/1 @1 g0 a0)
>> (inner handle already deleted)
>>
>>
>>Here is one that worked from the hand run perl program:
>>
>> DBI dispatch debug level set to 9
>> dbih_setup_handle(DBI::dr=HASH(0x1013e258)=>DBI::dr=HASH(0x10100288),
PS> DBD::mysql::dr, 0, Null!)
>> dbih_make_com(Null!, DBD::mysql::dr, 72)
>> >> connect DISPATCH (DBI::dr=HASH(0x1013e258) rc1/3 @5 g0
PS> a10164df8)
>> -> connect for DBD::mysql::dr (DBI::dr=HASH(0x1013e258)~0x10100288
PS> 'test_db' 'username' 'password' HASH(0x100d4b08))
>> dbih_setup_handle(DBI::db=HASH(0x101002e8)=>DBI::db=HASH(0x1015e6e4),
PS> DBD::mysql::db, 1013e0a8, Null!)
>> dbih_make_com(DBI::dr=HASH(0x10100288), DBD::mysql::db, 416)
>>imp_dbh->connect: dsn = test_db, uid = username, pwd = password
>> <- connect= DBI::db=HASH(0x101002e8)
>> >> STORE DISPATCH (DBI::db=HASH(0x1015e6e4) rc2/1 @3 g0 a0)
>> -> STORE for DBD::mysql::db (DBI::db=HASH(0x1015e6e4) 'PrintError' 1)
>> STORE DBI::db=HASH(0x1015e6e4) 'PrintError' => 1
>> <- STORE= 1
>> >> STORE DISPATCH (DBI::db=HASH(0x1015e6e4) rc2/1 @3 g0 a0)
>> -> STORE for DBD::mysql::db (DBI::db=HASH(0x1015e6e4) 'RaiseError' 1)
>> STORE DBI::db=HASH(0x1015e6e4) 'RaiseError' => 1
>> <- STORE= 1
>>
>>The error from the web is:
>>
>>Software error:
>>
>>Can't connect to local MySQL server at
PS> /home/sites/common/modules/prefix_suffix.pm line 217
>>
>>It does not seem to matter how I code the perl, I cannot access the
>>database. I even downloaded several other programs that attempt to
>>access a mySQL database via perl CGI scripts, and none of them work
>>either.
>>
>>Does anyone have an idea where it is not working?
>>
>>
>>Richard
PS> _______________________________________________
PS> cobalt-users mailing list
PS> cobalt-users@xxxxxxxxxxxxxxx
PS> http://list.cobalt.com/mailman/listinfo/cobalt-users
Regards,
Steve Hamilton
KTUU - Web Manager
http://www.ktuu.com
mailto:WebManager@xxxxxxxx