Perl-mysql
2 answers - 414 bytes -

Hi,
I would like to connect to a database stored at linux
machine from my Windows machine. But I am unable to connect to the mysql
server.
Please help me regarding this issue.
use DBI;
$dbh = DBI->connect("", 'root',
'abc123',
{ RaiseError =1 }
);
#do something here
}
$dbh->disconnect();
Thanks in advance
No.1 | | 1925 bytes |
| 
first, sharing the error message you get when trying to connect will
help isolate the actual cause of the problem.
second, getting rid of all the extraneous whitespace in your code
fragment will help in reading the code.
as for possible causes of the error:
1. DBI->connect syntax may be incorrect (i haven't looked it up to verify)
2. ip address may no longer be correct if it is a dynamic ip (even on
a home system)
3. networking for mysql may not be active
4. mysql may not be running
5. user "root" may not be allowed to connect via network (ie.
external) connection
6. user "root" may not have the same password you are passing
7. database "employee" may not exist or may be corrupt
there could be other possibilities, these are just the ones that come to mind.
8/30/06, Manne, Siva Chaitanya Prasad
<SivaChaitanya.Manne (AT) in (DOT) unisys.comwrote:
>
>
>
>
Hi,
I would like to connect to a database stored at linux
machine from my Windows machine. But I am unable to connect to the mysql
server.
>
>
>
Please help me regarding this issue.
>
>
>
>
>
>
>
>
use DBI;
$dbh = DBI->connect("", 'root',
'abc123',
{ RaiseError =1 }
);
>
>
>
#do something here
>
>
>
}
>
>
>
$dbh->disconnect();
>
>
>
>
>
Thanks in advance
>
>
>
>
>
--
siva
>
>
>
>
>
No.2 | | 496 bytes |
| 
8/30/06, Manne, Siva Chaitanya Prasad
<SivaChaitanya.Manne (AT) in (DOT) unisys.comwrote:
Hi,
I would like to connect to a database stored at linux
machine from my Windows machine. But I am unable to connect to the
mysql
server.
The error I am getting is
"DBI connect('employee:xxx.xxx.xxx.xx','root',) failed: Unknown MySQL
server host 'xxx.xxx.xxx.xx' (11001) at
d:\pras\webshare\common\siva\mysql\mysql.pl line 2"