Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl-Sensitive Sunglasses

Re: Re: Using mysql with perl

by Trimbach (Curate)
on Jun 07, 2003 at 14:10 UTC ( #263964=note: print w/replies, xml ) Need Help??

in reply to Re: Using mysql with perl
in thread Using mysql with perl

This isn't Perl, but here goes...

An ISP that allows you to use MySQL almost certainly will give you login access to the database server WITHOUT giving you access to the physical location on their server where the database is located. So, you won't be able to "upload the database files" anywhere... the best you'll be able to do is export your data from your local tables into a portable (tab or pipe-delimited format), upload that to your ISP, and then connect to your MySQL account and use SQL like LOAD DATA INFILE to import your table data from the flat file to the ISP's database.

For more details on how to do this (and, in fact, to learn just about everything there is to know about MySQL) check out the MySQL online manual.

Gary Blackburn
Trained Killer

Replies are listed 'Best First'.
Re: Re: Re: Using mysql with perl
by Anonymous Monk on Jun 07, 2003 at 16:39 UTC
    Another way is to write a small DBI script that connects to both DB's: your local one, and the internet one. The script then reads from your own local, and inserts everything into the other one.

    The advantage is that you can use it anytime once you've written it once, and adjust it to work for any table you like.

      Yes, but remember:
      1. If your local machine is behind a firewall (and, really, whose isn't?) then you have to punch a hole through your local firewall to allow the remote script to connect to your database.
      2. Unless you're using an SSL flavor of MySQL (4.x) or tunneling through SSH, you're transmitting your id, password, and data across an unsecure, unencrypted internet connection. Even if your data is uninteresting, it's not a good idea to let the World know the id and password to your exposed MySQL database.

      Other than that it's a great idea. :-) When dealing with an ISP it's much better just to SCP the data to your ISP, and load it that way.

      Gary Blackburn
      Trained Killer

Log In?

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://263964]
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others surveying the Monastery: (2)
As of 2021-10-27 13:58 GMT
Find Nodes?
    Voting Booth?
    My first memorable Perl project was:

    Results (93 votes). Check out past polls.