in reply to Timeout problems (DBI)

I'm assuming that you really know of a specific mysql server that's running somewhere, and are really using the appropriate host, user and password parameters to connect to that. (It is of course totally appropriate and correct that you do not include that specific information in any post at PerlMonks.)

In my own access function for connecting to a mysql server, my dsn string goes like this:

$dsn = "DBI:mysql:database=test;host=host.name.dom"
I don't know if that'll make the difference in your case, but it works for me, and it's something that differs between my working code and your non-working code.

Apart from that, have you determined that you are able to connect to the database by other (non-perl) means -- e.g. can you run a mysql client from the command line and connect to that database using the given user/password/host/dbname values?

I also tend to set RaiseError to true, so if the connect fails, the script dies right away with an error message. You should at least check for success from the DBI "connect" call, if you're not going to set the RaiseError parameter.

Replies are listed 'Best First'.
Re^2: Timeout problems (DBI)
by FireBird34 (Pilgrim) on Sep 15, 2004 at 02:23 UTC
    Well, I've got the problem figured out now... It's not a Perl problem, but a MySQL problem. It's an Access Denied error. No idea why, but I'm still looking around. I can log into 'mysql' via command prompt, however doing the trouble shooting, I can't change my password in it =P I'll still keep messing with it. Since it's not a Perl issue, not worth keeping this going, however I'll still take any input. Thanks for the help =)

    EDIT: I've fixed this somewhat; the program just hangs now, doing nothing... it hangs at the connect command. Can't figure it out...
      I bet it turned out to be a problem in the priveledge table. You probably set your username up to accept connections from localhost and any host but not for the specific IP address that you were calling in your "database=test, host=x.x.x.x" statement. Oh, and dbi:mysqlPP is valid if you have DBI::mysqlPP installed, and dbi:mysql is valid if you have DBI::Mysql installed.