LinuxQuestions.org
Register a domain and help support LQ
Go Back   LinuxQuestions.org > Forums > Other *NIX Forums > *BSD
User Name
Password
*BSD This forum is for the discussion of all BSD variants.
FreeBSD, OpenBSD, NetBSD, etc.

Notices



Reply
 
Search this Thread
Old 01-10-2010, 10:16 AM   #1
mindsport
Member
 
Registered: Apr 2005
Location: Florida
Distribution: Slackware 13.1-64bit / 2.6.33.4
Posts: 45

Rep: Reputation: 17
Net::Mysql


I'm having trouble with this perl mod, everytime i query something it never returns back to the perl script.. heres my script, description of sql setup, debug, etc.. anyhelp would be greatful. thanks!

Note: I added the got here prints to see where it stops and the only
one printed is got here1 query never returns..

Perl script:
Code:
#!/usr/bin/perl

use warnings;
use Net::MySQL;

my $mysql = Net::MySQL->new(
#        hostname => '127.0.0.1',
        database => 'adam',
        user     => 'mind',
        debug    => 'TRUE',
        password => 'x'
);

print "got here1\n";

$mysql->query(q{SELECT name FROM test});

print "got here2\n";

if ($mysql->has_selected_record) {
        my $a_record_iterator = $mysql->create_record_iterator;
        print $a_record_iterator."\n";
}

print "got here3\n";
$mysql->close();
Mysql table in database adam:
Code:
mysql> describe test;
+-------+--------------+------+-----+---------+-------+
| Field | Type         | Null | Key | Default | Extra |
+-------+--------------+------+-----+---------+-------+
| NAME  | varchar(255) | NO   |     | NULL    |       |
+-------+--------------+------+-----+---------+-------+
1 row in set (0.01 sec)

mysql> select name from test;
+------+
| name |
+------+
| bob  |
+------+
1 row in set (0.00 sec)
when I run the command with debug on:

Code:
Use INET Socket: 127.0.0.1 3306/tcp
Net::MySQL::_get_server_information():
38 00 00 00 0A 35 2E 31 6E 33 30 2D 6C 6F 67 00  8....5.1.30-log.
C7 8A 00 00 2D 23 23 74 43 2E 5C 64 00 FF F7 08  ....-).tC..d....
02 00 00 00 00 00 00 00 00 00 00 00 00 00 00 61  ...............a
3B 40 72 3C 73 4F 72 6E 25 3B 66 00              ;.r.sOrnU;f.
Protocol Version: 10
Server Version: 5.1.30-log
Salt: -)#tC.\da;@r<sOrnU;f
Net::MySQL::_send_login_message():
3F 00 00 01 0D A6 03 00 00 00 00 01 21 00 00 00  ?...............
00 00 00 00 10 00 00 00 00 00 00 00 00 00 00 00  ................
00 00 00 00 6D 69 3E 64 00 14 79 EA 09 74 0F 02  ....mind..y..t..
B7 CA CD 35 22 3C 32 30 B3 34 90 34 00 BB 61 64  ......20.4.4..ad
61 6D 00                                         am.
Net::MySQL::_request_authentication():
07 00 00 02 00 30 00 02 00 05 00                 ...........
connect database
got here1
Net::MySQL::_execute_command():
16 00 00 00 03 53 45 4C 45 43 54 20 6E 61 6D 65  .....SELECT.name
20 46 52 4F 4D 20 74 65 73 74                    .FROM.test
Net::MySQL::_execute_command():
01 00 00 01 01 2A 00 00 02 03 64 65 66 04 61 64  .....*....def.ad
61 6D 04 74 65 73 74 04 74 65 73 74 04 6E 61 6D  am.test.test.nam
65 04 4E 41 4D 45 0C 21 00 FD 02 00 00 FD 01 10  e.NAME..........
00 00 00 05 00 00 03 FE 00 00 02 00 04 00 00 04  ................
03 62 6F 62 05 00 00 05 FE 00 00 02 00           .bob.........
 
Old 01-10-2010, 11:32 PM   #2
ocicat
Member
 
Registered: May 2007
Posts: 208

Rep: Reputation: 48
Quote:
Originally Posted by mindsport View Post
I'm having trouble with this perl mod, everytime i query something it never returns back to the perl script.. heres my script, description of sql setup, debug, etc..
Stating which *BSD & what version might be helpful.
 
  


Reply

Tags
mod, mysql, perl


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
MySQL Connector/.NET (Mono) BrajZore Linux - Server 0 11-02-2009 08:19 AM
LXer: Nexen.net: Portail PHP/MySQL LXer Syndicated Linux News 0 02-28-2007 01:31 PM
asp.net and mysql on linux montylee Programming 0 02-05-2004 04:24 AM
ASP.NET nd MySQL montylee Linux - Newbie 0 02-05-2004 04:21 AM
ASP.NET and MySQL montylee Programming 0 02-04-2004 12:34 AM


All times are GMT -5. The time now is 06:48 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration