Thank you for all your suggestions,
I got it.
the problem was in our web server because of security $ENV{HOME} doesnt
point to my home directory so my .my.cnf file was unreachable.
That's it.
may be It can be helpful for other people as well.

>     my %attr = (
>       PrintError =>0,
>       RaiseError =>0
>               );
> 
>     $dbh = DBI->connect(
> "DBI:mysql:array;mysql_read_default_file=$ENV{HOME}/.my.cnf",
>                       "root",
>                       "",
>                        \%attr);
>     if (defined($dbh)){
>       print "\n Connected successfully", $DBI::errstr;
>       $rc = STATUS_OK;
>       $dbh->disconnect;
>     }
>     else {
>       print "\n $DBI::errstr\n";
>       $rc = undef;
> 
>     }
> 
----------------------------------------------------------------------
Mohammadreza Shojatalab                              
European Bioinformatics Institute    Tel: +44 (0)1223 494 669                          
  
EMBL Outstation                      Fax: +44 (0)1223 494 468                          
  
Wellcome Trust Genome Campus         E-Mail: [EMAIL PROTECTED]                           
  
Hinxton, Cambridge                   URL: http://www.ebi.ac.uk/~shoja                  
  
CB10 1SD, UK


---------------------------------------------------------------------
Before posting, please check:
   http://www.mysql.com/manual.php   (the manual)
   http://lists.mysql.com/           (the list archive)

To request this thread, e-mail <[EMAIL PROTECTED]>
To unsubscribe, e-mail <[EMAIL PROTECTED]>
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php

Reply via email to