Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:

Hai, I have installed mysql in my windows98. I installed ActiveState perl. I installed DBI and i installed Bundle::DBD::mysql. When i run my program it is saying that it cannot connect to the database. It's Giving error in the line DBI->connect(..); Following is the Error message:
[Thu Oct 11 16:09:47 2001] [error] [client 127.0.0.1] DBI->connect(dat +abase=test;host=192.168.254.183;port=3306;) failed: Can't connect to +MySQL server on 192.168.254.183 (10061) at c:/apache/cgi-bin/my_pl/db +test.pl line 9
Can anyone help me out in this regard THX in advance jagan

Replies are listed 'Best First'.
Re: Can't Connect to MySQL Database
by Ovid (Cardinal) on Dec 12, 2001 at 03:01 UTC

    Personally, I think not being able to connect to a MySQL database is a Good Thing :), but since you ask, how about creating an ODBC connection? If I recall correctly, it's in Start->Settings->Control Panel and the program is "Data Sources (ODBC)" - or something similar (you may have to drill down further to 'Administrative Tools').

    From there, click on the System DSN tab, click add, and follow the screens. With that, your DBI connection will resemble the following:

    DBI->connect( 'dbi:ODBC:mydatabase','user', 'pass', { RaiseError => 1 } );
Re: Can't Connect to MySQL Database
by Anonymous Monk on Dec 13, 2001 at 05:14 UTC
    Hai thanks a lot Mr. Ovid and Mr. bmccoy for replying my question. Anyway i was able to configure on my own before reading ur answers. I reinstalled perl and i installed drivers for all database, now i am able to connect to MySQL, SQL server and oracle. Anyway thanks a lot for ur kind guidance. regards jagan
Re: Can't Connect to MySQL Database
by bmccoy (Beadle) on Dec 12, 2001 at 08:47 UTC
    A couple of different to look at:

    1. Have you tried connecting to the database via the localhost address (127.0.0.1)?

    2. Is the database server actually up and running?

    3. Can you connect via the command-line client?

    4. Do you have a user and password set up to connect with?

    5. It helps a great deal if you can show the code that is giving you trouble.

    -- Brett