LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   *BSD (https://www.linuxquestions.org/questions/%2Absd-17/)
-   -   Net::Mysql (https://www.linuxquestions.org/questions/%2Absd-17/net-mysql-781239/)

mindsport 01-10-2010 09:16 AM

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.........


ocicat 01-10-2010 10:32 PM

Quote:

Originally Posted by mindsport (Post 3821188)
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.


All times are GMT -5. The time now is 10:05 AM.