I have some perl code that I am trying to get working. It runs on win32 (Windows 2003 Server) on ActiveState Perl (Build 631). The mysql server is running on a Linux machine that I have no problems connecting to otherwise. The code is (IP and username sanitized for security):
#!perl.exe use strict; use warnings; use Win32::OLE; use Win32::OLE::Variant; use Win32::OLE::Const 'Microsoft Outlook'; use DBI(); my $dbhost = '1.2.3.4'; my $dbuser = 'user'; my $dbdb = 'ssis'; my $dsn = "DBI:mysql:database=$dbdb;host=$dbhost"; my $dbh; print "Connecting to DB ...\n"; print "dsn: $dsn\n"; $dbh = DBI->connect($dsn,$dbuser,'') or die "couldn't connect to $dbho +st: " . DBI->errstr . "\n"; print "Done with DB connection\n";
And the output is:
C:\Data\Scripts\Exchange>mysql_connect.pl Connecting to DB ... dsn: DBI:mysql:database=ssis;host=1.2.3.4 C:\Data\Scripts\Exchange>

update: Just tried this for kicks with a different and unauthorized username and it behaves in exactly the same way as it does with a correct and authorized username?!

Any thoughts as to why this just dies without the error message and without printing the text after the connect code?

Ed


In reply to connecting to Mysql from Win32 by bfdi533

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.