LaSet (laset) wrote in lj_everywhere,
LaSet
laset
lj_everywhere

Role.pm line 230

Hi

What's the problem with Role.pm line 230?

[Checking LJ Environment...]
Use of uninitialized value in concatenation (.) or string at /home/lj/public_html/cgi-bin/DBI/Role.pm line 230.
Use of uninitialized value in concatenation (.) or string at /home/lj/public_html/cgi-bin/DBI/Role.pm line 230.

Problem:
  * Couldn't get master database handle.


I've found a few the same anresolved issues here and here

I'd greatly appriciate any help. Thanks!

Role.pm
...
sub make_dbh_fdsn
{
    my $self = shift;
    my $db = shift;   # hashref with DSN info
    return $db->{'_fdsn'} if $db->{'_fdsn'};  # already made?

    my $fdsn = "DBI:mysql";  # join("|",$dsn,$user,$pass) (because no refs as hash keys)
    $db->{'dbname'} ||= $self->{'DEFAULT_DB'} if $self->{'DEFAULT_DB'};
    $fdsn .= ":$db->{'dbname'}";
    $fdsn .= ";host=$db->{'host'}" if $db->{'host'};
    $fdsn .= ";port=$db->{'port'}" if $db->{'port'};
    $fdsn .= ";mysql_socket=$db->{'sock'}" if $db->{'sock'};
230 $fdsn .= "|$db->{'user'}|$db->{'pass'}";

    $db->{'_fdsn'} = $fdsn;
    return $fdsn;
}
...
ljconfig.pl
...
    %DBINFO = (
                   # master must be named 'master'
               'master' => {
                   'host' => "localhost",
                   'port' => 2083,
                   'dbname' => 'lj_db',
                   'user' => 'lj_user',
                   'pass' => 'pass',
                   'role' => {
                       'cluster1' => 1,

                       # optionally, apache write its access logs to a mysql database
                       #logs => 1,
                   },
               },
               # example of a TCP-based DB connection
               # ....
               # example of a UNIX domain-socket DB connection
               # ...
               );
Subscribe
  • Post a new comment

    Error

    Comments allowed for members only

    Anonymous comments are disabled in this journal

    default userpic

    Your IP address will be recorded 

  • 4 comments