[rfc] Net::MySQL & DBD::mysqlPP

Net::MySQL   - Pure Perl MySQL client network protocol interface for the Perl
DBD::mysqlPP - Pure Perl MySQL driver for the Perl Database Interface (DBI)

Net::MySQL and DBD::mysqlPP is a Pure Perl client interface for the
MySQL database. This module implements network protool between server
and client of MySQL, thus you don't need external MySQL client library
like libmysqlclient for this module to work. It means this module
enables you to connect to MySQL server from some operation systems which
MySQL is not ported.

    http://ymca.infoware.ne.jp/dist/Net-MySQL-0.01.tar.gz
    http://ymca.infoware.ne.jp/dist/DBD-mysqlPP-0.01.tar.gz

Net::MySQL
==========

    #!perl
    use Net::MySQL;
    use strict;

    my $mysql = Net::MySQL->new(
        hostname => 'mysqld.example.jp',
        database => 'database',
        user     => 'username',
        password => 'password'
    );
    $mysql->query(q{SELECT id, name FROM table});
    my $record = $mysql->create_record_iterator;
    while (my $column = $record->each) {
        printf "id=%s, name=%s\n",
            $column->[0], $column->[1];
    }
    $mysql->close;
    __END__


DBD::mysqlPP
============

    #!perl
    use DBI;
    use strict;

    my $dbh = DBI->connect(
        'dbi:mysqlPP:hostname=mysqld.example.jp;database=database',
        'username', 'password'
    );
    my $sth = $dbh->prepare(q{SELECT id, name FROM table});
    $sth->execute;
    while (my $col = $sth->fetchrow_arrayref) {
        printf "id=%s, name=%s\n", $col->[0], $col->[1];
    }
    $dbh->disconnect;
    __END__
______________
Hiroyuki OYAMA
0
oyama
3/31/2002 3:19:15 PM
perl.dbi.users 11085 articles. 1 followers. Follow

4 Replies
363 Views

Similar Articles

[PageSpeed] 16

Cool.

I trust the docs describe explicitly any and all differences between
DBD::mysql and DBD::mysqlPP.

Will you get a PAUSE account and upload to CPAN?

Tim.

On Mon, Apr 01, 2002 at 12:19:15AM +0900, Hiroyuki OYAMA wrote:
> Net::MySQL   - Pure Perl MySQL client network protocol interface for the Perl
> DBD::mysqlPP - Pure Perl MySQL driver for the Perl Database Interface (DBI)
> 
> Net::MySQL and DBD::mysqlPP is a Pure Perl client interface for the
> MySQL database. This module implements network protool between server
> and client of MySQL, thus you don't need external MySQL client library
> like libmysqlclient for this module to work. It means this module
> enables you to connect to MySQL server from some operation systems which
> MySQL is not ported.
> 
>     http://ymca.infoware.ne.jp/dist/Net-MySQL-0.01.tar.gz
>     http://ymca.infoware.ne.jp/dist/DBD-mysqlPP-0.01.tar.gz
> 
> Net::MySQL
> ==========
> 
>     #!perl
>     use Net::MySQL;
>     use strict;
> 
>     my $mysql = Net::MySQL->new(
>         hostname => 'mysqld.example.jp',
>         database => 'database',
>         user     => 'username',
>         password => 'password'
>     );
>     $mysql->query(q{SELECT id, name FROM table});
>     my $record = $mysql->create_record_iterator;
>     while (my $column = $record->each) {
>         printf "id=%s, name=%s\n",
>             $column->[0], $column->[1];
>     }
>     $mysql->close;
>     __END__
> 
> 
> DBD::mysqlPP
> ============
> 
>     #!perl
>     use DBI;
>     use strict;
> 
>     my $dbh = DBI->connect(
>         'dbi:mysqlPP:hostname=mysqld.example.jp;database=database',
>         'username', 'password'
>     );
>     my $sth = $dbh->prepare(q{SELECT id, name FROM table});
>     $sth->execute;
>     while (my $col = $sth->fetchrow_arrayref) {
>         printf "id=%s, name=%s\n", $col->[0], $col->[1];
>     }
>     $dbh->disconnect;
>     __END__
> ______________
> Hiroyuki OYAMA
0
Tim
4/1/2002 8:12:24 PM
> On Mon, Apr 01, 2002 at 12:19:15AM +0900, Hiroyuki OYAMA wrote:
>
> > Net::MySQL   - Pure Perl MySQL client network protocol interface for the Perl
> > DBD::mysqlPP - Pure Perl MySQL driver for the Perl Database Interface (DBI)

Congratulations!

The modules install fine on windows98 with activestate build 629.  The
example #1 in your pod works except for the one insertion with
placeholders which fails and these minor problems:

  Useless use of a variable in void context at ...DBD/mysqlPP.pm line
11.

  in cleanup) Driver has not implemented DESTROY for
DBI::db=HASH(0x1d32eb4) at ...

The example #1 script also works with DBI::PurePerl.

-- 
Jeff
0
jeff
4/1/2002 8:44:48 PM
Oyama-san,

At Mon, 1 Apr 2002 00:19:15 +0900,
Hiroyuki OYAMA wrote:
 
> Net::MySQL   - Pure Perl MySQL client network protocol interface for the Perl
> DBD::mysqlPP - Pure Perl MySQL driver for the Perl Database Interface (DBI)
> 
> Net::MySQL and DBD::mysqlPP is a Pure Perl client interface for the
> MySQL database. This module implements network protool between server
> and client of MySQL, thus you don't need external MySQL client library
> like libmysqlclient for this module to work. It means this module
> enables you to connect to MySQL server from some operation systems which
> MySQL is not ported.

I believe DBD::mysqlPP now has become really cool and usable in many
platforms, because there's even DBI::PurePerl. Perfect timing! :)


-- 
Tatsuhiko Miyagawa <miyagawa@edge.co.jp>
0
miyagawa
4/2/2002 3:09:06 AM
Thank you for a comment.

> I trust the docs describe explicitly any and all differences between
> DBD::mysql and DBD::mysqlPP.

I agree with the necessity for the information. It
arranges based on the information on perldoc DBD::mysql.

After this work finishes, it posts to CPAN.
______________
Hiroyuki OYAMA
0
oyama
4/4/2002 6:13:34 AM
Reply:

Similar Artilces:

ANNOUNCE: Net::MySQL 0.08 & DBD::mysqlPP 0.04
Net::MySQL 0.08 & DBD::mysqlPP 0.04 has been released an uploaded to CPAN. file: $CPAN/authors/id/O/OY/OYAMA/Net-MySQL-0.08.tar.gz size: 9434 bytes md5: bb8c17d4d77ab5cba3fd6838b8516444 file: $CPAN/authors/id/O/OY/OYAMA/DBD-mysqlPP-0.04.tar.gz size: 7444 bytes md5: 7b6a31289c8c2e54bfcdfcdbd54da9b2 Changes in Net::MySQL: ---------------------- 0.08 Fri Jan 24 19:33:08 JST 2003 - Bugfix _get_field_length(). to platform independent. (Thanks to Aigars Grins, http://rt.cpan.org/NoAuth/Bug.html?id=1980) Changes in DBD::mysqlPP: ------------...

DBD::mysqlPP and NET::MySQL
Hi all, I'm working on a perl-script connecting to myqsl using the above modules. This script works fine on one database-server, but if I try another on (both mysql-version 3.23.55) I get a warning from Net::Mysql: in short at /usr/lib/perl5/site-perl/5.6.1/Net/MySQL.pm line 591. What does that mean? Is there something wrong with the tables in the second database server (because in the first server everything works fine without a warning)? Thankful for any help! Best regards, Stephan I think you should tell a little more as to what the warning is, while a war...

DBI w/ DBD:ODBC or DBI w/ DBD:mysql Which?
------=_NextPart_000_0009_01C1D022.ADFABA00 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable I am new to Perl DBI programming But it is fairly simple.. I am using both Mysql 3.23.44nt and 3.23.43 Linux..as well as PostgreSQL 7.1 Linux and on WinXP on Cygwin. Perl on Linux was straight forward but the Perl on WIn is a bit = Different. I ran a simple script to insert records in a table as test and it worked = but I am unsure that the WinXP install of Perl and DBI is correct that is do I = have the=20 correct modules in place. ...

DBI w/ DBD:ODBC vs DBI w/ DBD:mysql
------=_NextPart_000_002D_01C1D002.8689BBD0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable I am new to Perl DBI programming But it is fairly simple.. I am using both Mysql 3.23.44nt and 3.23.43 Linux..as well as PostgreSQL 7.1 Linux and on WinXP on Cygwin. Perl on Linux was straight forward but the Perl on WIn is a bit = Different. I ran a simple script to insert records in a table as test and it worked = but I am unsure that the WinXP install of Perl and DBI is correct that is do I = have the=20 correct modules in place. ...

[rfc] Net::PostgreSQL & DBD::PgPP
Net::PostgreSQL - Pure Perl PostgreSQL network protocol interface. DBD::PgPP - Pure Perl PostgreSQL database driver for the DBI=20 module. Net::PostgreSQL and DBD::PgPP is a Pure Perl client interface for the PostgreSQL database. This module implements network protool between server and client of PostgreSQL, thus you don't need external PostgreSQL client library like "libpq" for this module to work. It means this = module enables you to connect to PostgreSQL server from some operation systems which PostgreSQL is not ported. http://ymca.infoware.ne.jp/dist/Net...

Problem w/ $dbh->column_info() using current DBI & DBD::mysql
--------------060303000607000209070207 Content-Type: multipart/alternative; boundary="------------080805070003000005080308" --------------080805070003000005080308 Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit I've been using an alpha version of column_info that Tim Bunce sent the Class::DBI list ages ago in connection with some code to extend Class::DBI. AFAICS, it's precisely what's in the latest version of DBD::mysql. I got it to work without any finding bugs except it couldn't handle tablenames that inc...

mysql 4.1x and DBD::mysql (and mysqlPP)
I saw a discussion about that on the list, but I've recently upgraded to 4.1.7-nt for testing and now I can't connect to the server from perl. I remember someone suggested re-compiling DBD::mysql from source against new libraries, but DBD::mysqlPP also can not connect to the server (also I'm not very familiar with linking/compiling process). So, are there any other suggestions? [Perl: Active Perl 5.8.4 build 810; OS: Windows XP Professional/SP2 DBD::mysql installed via ppm] Test code: #!/usr/bin/perl -w use strict; use DBI; my $driver = "mysql"; ...

DBD::mysql & DBD::Pg email.
Hey all, I have been pretty much offline for the past 2 weeks or so because of an illness in the family so that is why I have not been responding to any DBD::mysql/DBD::Pg related email (actually any email whatsoever). I will be sorting through spam and answering email tomorrow. Rudy ...

Connector/NET of ASP.NET & MySQL
I'm using Connector/NET to connect to MySQL from ASP.NET 2.0. But the problem is my hosting server only support ODBC connector and I don't want to use it.Is there any solution, such as importing the driver to the application or anything else? Hi, I'm not quite sure if I understood the question, but can't you just copy the MySql.dll to your sites bin directory and use connectionstring that uses localhost as server? Best regards Heiskanen- Heiskanen You can deploy the connector's assemblies with your web application. There is no need to install them on the destination server. This shoul...

DBD & DBI for Oracle7 & 8
Hi, Can somebody tell the location( i mean Perl sites ) and version of DBI and DBD which will work on both Oracle7 & 8 ( i have to work on both databases simultaneously ). Thanks & Regards Sridhar ...

DBI & DBD::Oracle & ithreads
Hi, as perl Makefile.PL says and my test confirms does DBI & DBD::Orcale not work with concurrent threads. I like to use it with mod_perl 2, perl 5.8.0 and ithreads under windows. So I have a few question how I might get this working: - Is the oracle c library under windows thread safe at all? If not, I think the only chance we have is to serialize all calls into the oracle c code. - If the orcale code isn't the problem, is it a problem in DBI itself or in DBD::Oracle or both? - If it is an DBI/DBD problem are there any known points in the code which may cause the p...

AW: mysql 4.1x and DBD::mysql (and mysqlPP)
Hello, What I know, MySQL changed in 4.1 the password mechanism, so is it = possible, thar you need knew passwords in our DB. I have these Problem in some application, which makes pass check over = MySQL :-( By Alex =20 > -----Urspr=FCngliche Nachricht----- > Von: Burak G=FCrsoy [mailto:burakgursoy@gmx.net]=20 > Gesendet: Donnerstag, 4. November 2004 13:37 > An: perl-DBI > Betreff: mysql 4.1x and DBD::mysql (and mysqlPP) >=20 > I saw a discussion about that on the list, but I've recently=20 > upgraded to 4.1.7-nt for testing and now I can't co...

Connecting to localhost MySQL DB with Asp.NET & VB.NET
I'm fairly new to this so please bear with me. I installed MySQL on my local machine and created a database and table. I created a User DSN and a System DSN and they tested ok.Here's my .net code:Code:<%@ Page Language="VB" Debug="false" AutoEventWireup="false" CodeFile="Default.aspx.vb" Inherits="_Default" %> <%@ import Namespace="System.Data" %> <%@ import Namespace="System.Data.Odbc" %> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/T...

Fw: DBI w/ DBD:ODBC or DBD:mysql or DBIx-AnyDBD
------=_NextPart_000_0034_01C1D12E.53400590 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable ----- Original Message -----=20 From: Bob T=20 To: dbi-users@perl.org=20 Sent: Thursday, March 21, 2002 11:10 PM Subject: Fw: DBI w/ DBD:ODBC or DBD:mysql or DBIx-AnyDBD ----- Original Message -----=20 From: Bob T=20 To: perl-win32-database@NO-SPAM.listserv.ActiveState.com=20 Sent: Thursday, March 21, 2002 11:08 PM Subject: DBI w/ DBD:ODBC or DBD:mysql or DBIx-AnyDBD I am new to Perl DBI programming it is fairly simple..E...

Web resources about - [rfc] Net::MySQL & DBD::mysqlPP - perl.dbi.users

Resources last updated: 11/26/2015 10:18:15 PM