FAQ
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("DBI:mysql:employee:xxx.xxx.xxx.xx", 'root',
'abc123',

{ RaiseError => 1 }

);



#do something here



}



$dbh->disconnect();





Thanks in advance





--

siva

Search Discussions

  • Jm at Aug 30, 2006 at 2:04 pm
    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.



    On 8/30/06, Manne, Siva Chaitanya Prasad
    wrote:



    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("DBI:mysql:employee:xxx.xxx.xxx.xx", 'root',
    'abc123',

    { RaiseError => 1 }

    );



    #do something here



    }



    $dbh->disconnect();





    Thanks in advance





    --

    siva




    --
    since this is a gmail account, please verify the mailing list is
    included in the reply to addresses
  • Manne, Siva Chaitanya Prasad at Aug 30, 2006 at 2:46 pm
    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"
    --
    I have used the exact ip address of the machine instead of
    xxx.xxx.xxx.xx
    ,the database "employee" is created properly and mysql is running


    Please help me regarding this issue.

    ************************************************************************
    use DBI;

    $dbh = DBI->connect("DBI:mysql:employee:xxx.xxx.xxx.xx", 'root',
    'abc123',{ RaiseError => 1 });

    #do something here
    $dbh->disconnect();

    ***********************************************************************

    Thanks
    siva
  • Jm at Aug 30, 2006 at 3:28 pm

    On 8/30/06, Manne, Siva Chaitanya Prasad wrote:

    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"
    --
    I have used the exact ip address of the machine instead of
    xxx.xxx.xxx.xx
    ,the database "employee" is created properly and mysql is running
    "Unknown MySQL server host 'xxx.xxx.xxx.xx' (11001)" indicates either
    your script can't find that particular ip or it can't find the mysql
    server on the proper port on that ip address (mysql/mysql-nt/whatever
    isn't running, or isn't set to the default port; i don't recall if
    having mysql's networking disabled only affects the user logins or the
    actual connectivity overall).

    try pinging the ip to see if one machine sees the other at all. if
    that responds satisfactorily, look deeper into the mysql
    configuration.

    one easy way to troubleshoot is to use the mysql client on the windows
    machine and try to connect as a remote user via an ip connection,
    retrying as you make each change to the configuration; you'll be on a
    single machine that way until you get it figured out.

    i would also STRONGLY suggest getting/reading MySQL by Paul DuBois,
    Third Edition - it'll cover every detail you could possibly want/need
    to know.

    one other possibility could be a firewall locking the port mysql is
    using for network connections.



    --
    since this is a gmail account, please verify the mailing list is
    included in the reply to addresses
  • Timothy Place at Aug 30, 2006 at 4:24 pm
    Hello all, my name is Tim and I have a website that I would like to get some help with, after transferring the files from one Hosting Service to another, some of the code doubled itself and when I went to remove it it really screwed my site up, I am not a PERL Person, although I am learning to use it. Can someone help please.

    jm wrote: On 8/30/06, Manne, Siva Chaitanya Prasad
    wrote:
    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"
    --
    I have used the exact ip address of the machine instead of
    xxx.xxx.xxx.xx
    ,the database "employee" is created properly and mysql is running
    "Unknown MySQL server host 'xxx.xxx.xxx.xx' (11001)" indicates either
    your script can't find that particular ip or it can't find the mysql
    server on the proper port on that ip address (mysql/mysql-nt/whatever
    isn't running, or isn't set to the default port; i don't recall if
    having mysql's networking disabled only affects the user logins or the
    actual connectivity overall).

    try pinging the ip to see if one machine sees the other at all. if
    that responds satisfactorily, look deeper into the mysql
    configuration.

    one easy way to troubleshoot is to use the mysql client on the windows
    machine and try to connect as a remote user via an ip connection,
    retrying as you make each change to the configuration; you'll be on a
    single machine that way until you get it figured out.

    i would also STRONGLY suggest getting/reading MySQL by Paul DuBois,
    Third Edition - it'll cover every detail you could possibly want/need
    to know.

    one other possibility could be a firewall locking the port mysql is
    using for network connections.



    --
    since this is a gmail account, please verify the mailing list is
    included in the reply to addresses

    --
    To unsubscribe, e-mail: beginners-unsubscribe@perl.org
    For additional commands, e-mail: beginners-help@perl.org






    Timothy Place

    Owner of http://www.lotofbids.com
    Online Auction Website and more,
    Help us make www.lotofbids.com #1




    ---------------------------------
    Get your own web address for just $1.99/1st yr. We'll help. Yahoo! Small Business.

Related Discussions

Discussion Navigation
viewthread | post
Discussion Overview
groupbeginners @
categoriesperl
postedAug 30, '06 at 1:34p
activeAug 30, '06 at 4:24p
posts5
users3
websiteperl.org

People

Translate

site design / logo © 2022 Grokbase