Beefy Boxes and Bandwidth Generously Provided by pair Networks
XP is just a number
 
PerlMonks  

How to connect to MySQL on pair.com

by Anonymous Monk
on Sep 15, 2005 at 22:55 UTC ( #492457=perlquestion: print w/ replies, xml ) Need Help??
Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:

Are any of you pair.com users? I am having problems getting my site moved over to them as I'm used to using Cpanel. I created a database and it gave me the login information for it.

This is the connection code I've always used in the past and it works, but it won't here. They did tell me a server address though but from my original code, I don't know where to include it.

use DBI; ################### # configurations ################### my $dbase = "111"; my $mysql_user = "222"; my $mysql_pass = "333"; ################### print header; my $dbh = DBI->connect("DBI:mysql:$dbase", $mysql_user, $mysql_pass) o +r print DBI->errstr; print "We are connected.<br>";
It said Database Server: db71b.pair.com. This is probably why it's not connecting. Can someone help me add that to the code or is anyone familiar with how to use their databases?

By the way, I did send them an email but it'll be a couple days until they get back to me probably.

I appreciate any help at all that you can give me.

Comment on How to connect to MySQL on pair.com
Download Code
Re: How to connect to MySQL on pair.com
by sh1tn (Priest) on Sep 15, 2005 at 23:26 UTC
    my $hostname = 'db71b.pair.com'; my $dbase = '111'; my $mysql_user = '222'; my $mysql_pass = '333'; my $dbh = DBI->connect( "DBI:mysql:$dbase:$hostname", $mysql_user, $mysql_pass, { RaiseError => 1, AutoCommit => 0 } ) || die "DB connection failed: $DBI::errstr\n"; # DB connection is successful if we are here ...
    Update: fixed wrong usage of $host/$hostname.


      (But s/hostname/host/ in first line?)
      chas

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: perlquestion [id://492457]
Approved by Paladin
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others about the Monastery: (7)
As of 2014-10-23 05:18 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    For retirement, I am banking on:










    Results (124 votes), past polls