FAQ
Hello DBI users,

I try to set up a MySQL database with a web interface via DBI. Database and
Apache web server run on different machines (both Debian Linux), and this is
where my problems start.

- is it possible to communicate to the remote database server with a syntax
like
my $dbh = DBI->connect('dbi:mysql:dbname@123.123.123.123', 'user', 'pw') ?

- in "Programming the Perl DBI", chapter 8, Alligator and Tim explain how to
set up a database proxy. Do I have to do that? That chapter read like a
whole bunch of trouble ...

- is there a way to properly install DBD::mysql without installing MySQL on
the web server? The documentation said that I had to install only the MySQL
client but almost all setup tests failed because of 'could not connect to
MySQL server' (of course it couldn't ...). I tried to direct the test
routines to the remote database but failed.

Thanks in advance to anyone who can help!

Greetings from Berlin,

Herbert Braun

Search Discussions

  • Herbold, John W. at Aug 25, 2003 at 1:42 pm
    Try:

    my $dbh = DBI->connect('dbi:mysql:database=helpdesk:host=123.123.123.123',
    'user', 'pw');

    Thanks,

    John W. Herbold Jr.
    Security Specialist
    501-399-3939



    -----Original Message-----
    From: Herbert Braun
    Sent: Monday, August 25, 2003 4:53 AM
    To: dbi-users@perl.org
    Subject: Database and Web Server on Different Machines


    Hello DBI users,

    I try to set up a MySQL database with a web interface via DBI. Database and
    Apache web server run on different machines (both Debian Linux), and this is
    where my problems start.

    - is it possible to communicate to the remote database server with a syntax
    like
    my $dbh = DBI->connect('dbi:mysql:dbname@123.123.123.123', 'user', 'pw') ?

    - in "Programming the Perl DBI", chapter 8, Alligator and Tim explain how to
    set up a database proxy. Do I have to do that? That chapter read like a
    whole bunch of trouble ...

    - is there a way to properly install DBD::mysql without installing MySQL on
    the web server? The documentation said that I had to install only the MySQL
    client but almost all setup tests failed because of 'could not connect to
    MySQL server' (of course it couldn't ...). I tried to direct the test
    routines to the remote database but failed.

    Thanks in advance to anyone who can help!

    Greetings from Berlin,

    Herbert Braun
  • Hardy Merrill at Aug 25, 2003 at 2:58 pm
    Tim or anyone else who knows, I was going to attempt to answer
    this question, but it's been a long while since I've had to
    setup a similar "dbserver on one machine, and webserver(db
    client) on another machine" scenerio, so I went looking for
    docs to describe it. I can't find any that describe what
    needs to be installed on what machine in order to accomplish
    this.

    Here's what I think:
    dbserver
    - install and setup MySQL *server* and get working
    properly
    - install DBI

    webserver (db client)
    - install MySQL *client*
    - install DBI
    - install DBD::mysql

    but I honestly can't remember. I've looked quickly through
    the DBI and DBD::mysql perldocs, and through the DBI FAQ at
    http://dbi.perl.org/doc/faq.html, but I can't find this
    described. Seems to me that this can be described in a
    generic way(db independent) in 'perldoc DBI', or more
    specifically in each DBD::??.

    I'd check the book "Programming the Perl DBI" which I think(?)
    describes this, but I don't have it handy. Besides, this
    info is basic enough that it should be available in the
    docs somewhere. Maybe it is, but I couldn't find it - if it
    is in the docs, please point it out to me and I'll go hide
    in a corner ;-)

    Thanks.

    --
    Hardy Merrill
    Red Hat, Inc.

    Herbert Braun [wortwart@woerter.de] wrote:
    Hello DBI users,

    I try to set up a MySQL database with a web interface via DBI. Database and
    Apache web server run on different machines (both Debian Linux), and this is
    where my problems start.

    - is it possible to communicate to the remote database server with a syntax
    like
    my $dbh = DBI->connect('dbi:mysql:dbname@123.123.123.123', 'user', 'pw') ?

    - in "Programming the Perl DBI", chapter 8, Alligator and Tim explain how to
    set up a database proxy. Do I have to do that? That chapter read like a
    whole bunch of trouble ...

    - is there a way to properly install DBD::mysql without installing MySQL on
    the web server? The documentation said that I had to install only the MySQL
    client but almost all setup tests failed because of 'could not connect to
    MySQL server' (of course it couldn't ...). I tried to direct the test
    routines to the remote database but failed.

    Thanks in advance to anyone who can help!

    Greetings from Berlin,

    Herbert Braun
  • Herbert Braun, Berlin Tourismus Marketing GmbH at Aug 25, 2003 at 11:09 pm
    I have set up the scenario you describe below and got a dummy connection
    running - even though 'make test' of DBD::mysql massively complained about
    not finding a database server ... I only looked in the DBI manual and in
    Tim's and Alligator's book but not in the DBD::mysql doc where the syntax is
    given:

    $dsn = "DBI:mysql:database=$database;host=$hostname;port=$port";

    I was surprised too that there is not much to find (i.e. I could not find
    it) about this problem ... we thought it would be a good idea for several
    reasons (security, performance, backups) to physically separate the two
    servers. I also was told that working on separate servers brings down the
    performance. We have not yet started performance tests - does anybody know
    anything about that subject?

    Thanks a lot to all who helped,

    Herbert Braun
    -----Ursprungliche Nachricht-----
    Von: Hardy Merrill
    Gesendet: Montag, 25. August 2003 16:58
    An: Herbert Braun
    Cc: dbi-users@perl.org
    Betreff: Re: Database and Web Server on Different Machines


    Tim or anyone else who knows, I was going to attempt to answer
    this question, but it's been a long while since I've had to
    setup a similar "dbserver on one machine, and webserver(db
    client) on another machine" scenerio, so I went looking for
    docs to describe it. I can't find any that describe what
    needs to be installed on what machine in order to accomplish
    this.

    Here's what I think:
    dbserver
    - install and setup MySQL *server* and get working
    properly
    - install DBI

    webserver (db client)
    - install MySQL *client*
    - install DBI
    - install DBD::mysql

    but I honestly can't remember. I've looked quickly through
    the DBI and DBD::mysql perldocs, and through the DBI FAQ at
    http://dbi.perl.org/doc/faq.html, but I can't find this
    described. Seems to me that this can be described in a
    generic way(db independent) in 'perldoc DBI', or more
    specifically in each DBD::??.

    I'd check the book "Programming the Perl DBI" which I think(?)
    describes this, but I don't have it handy. Besides, this
    info is basic enough that it should be available in the
    docs somewhere. Maybe it is, but I couldn't find it - if it
    is in the docs, please point it out to me and I'll go hide
    in a corner ;-)

    Thanks.

    --
    Hardy Merrill
    Red Hat, Inc.

    Herbert Braun [wortwart@woerter.de] wrote:
    Hello DBI users,

    I try to set up a MySQL database with a web interface via DBI.
    Database and
    Apache web server run on different machines (both Debian
    Linux), and this is
    where my problems start.

    - is it possible to communicate to the remote database server
    with a syntax
    like
    my $dbh = DBI->connect('dbi:mysql:dbname@123.123.123.123',
    'user', 'pw') ?
    - in "Programming the Perl DBI", chapter 8, Alligator and Tim
    explain how to
    set up a database proxy. Do I have to do that? That chapter read like a
    whole bunch of trouble ...

    - is there a way to properly install DBD::mysql without
    installing MySQL on
    the web server? The documentation said that I had to install
    only the MySQL
    client but almost all setup tests failed because of 'could not
    connect to
    MySQL server' (of course it couldn't ...). I tried to direct the test
    routines to the remote database but failed.

    Thanks in advance to anyone who can help!

    Greetings from Berlin,

    Herbert Braun
  • Unknown Sender at Aug 26, 2003 at 10:59 am
    W liście z pon, 25-08-2003, godz. 17:24, Herbert Braun, Berlin Tourismus
    Marketing GmbH pisze:
    I have set up the scenario you describe below and got a dummy connection
    running - even though 'make test' of DBD::mysql massively complained about
    not finding a database server ...
    I just took a look at DBD::mysql tests and I see that you can set
    shell's environment variable DBI_DSN to something like
    'DBI:mysql:database=test;host=your_mysql_server_host_name', DBI_USER to
    your mysql user name and DBI_PASS to your mysql user's password and than
    'make test' will be able to find your mysql database.

    Of course, you have to create mysql user first, but I presume, that You
    already did so, and that You already checked, if you can connect to your
    mysql server from your webserver using 'mysql' command.

    Hope that helps,

    Waldemar

Related Discussions

Discussion Navigation
viewthread | post
Discussion Overview
groupdbi-users @
categoriesperl
postedAug 25, '03 at 9:50a
activeAug 26, '03 at 10:59a
posts5
users5
websitedbi.perl.org

People

Translate

site design / logo © 2022 Grokbase