in reply to Canot connect to the remote mysql server through those lines

Nik,

you are here since 30.06.2003. Still didn't learn how to format posts? Have a look at Writeup Formatting Tips, please.

That said, just print the environmental variable to STDOUT and look into the server error logs. Do you find there what you expect?

If that's all ok, have a look whether the file '/var/run/mysqld/mysqld.sock' actually exists.

--shmem

_($_=" "x(1<<5)."?\n".q·/)Oo.  G°\        /
                              /\_¯/(q    /
----------------------------  \__(m.====·.(_("always off the crowd"))."·
");sub _{s./.($e="'Itrs `mnsgdq Gdbj O`qkdq")=~y/"-y/#-z/;$e.e && print}
  • Comment on Re: Canot connect to the remote mysql server through those lines

Replies are listed 'Best First'.
Re^2: Canot connect to the remote mysql server through those lines
by Nik (Initiate) on Jul 01, 2007 at 20:44 UTC
    Guys, this a remote server that i have only ftp access to it and some space to upload files.

    I cant check whether the file '/var/run/mysqld/mysqld.sock' exists or not, i aksed na admin though and he definately stated that the mysql server on freehostia runs normally. I also have no access to any of the error logs.

    I switched the code to this but it still produces the same error:

    #===================================================================== +========== my $db = ( $ENV{'SERVER_NAME'} !~ /freehostia/ ) ? DBI->connect('DBI:mysql:e_shop@localhost', 'root', '*****', { +RaiseError=>1}) : DBI->connect('DBI:mysql:nikkou6_db@mysql3.freehostia.com', 'n +ikkou6_db', '*****', {RaiseError=>1}); if( $ENV{'SERVER_NAME'} =~ /freehostia/ ) { $ENV{'DOCUMENT_ROOT'} = ' +/www/nikos.varsa.gr/' }; #===================================================================== +==========
      Consult the DBI docs. Your DSN doesn't fit. snopal gave you some hints.

      --shmem

      _($_=" "x(1<<5)."?\n".q·/)Oo.  G°\        /
                                    /\_¯/(q    /
      ----------------------------  \__(m.====·.(_("always off the crowd"))."·
      ");sub _{s./.($e="'Itrs `mnsgdq Gdbj O`qkdq")=~y/"-y/#-z/;$e.e && print}
      Keep your own log
      A reply falls below the community's threshold of quality. You may see it by logging in.