1

I need help figuring out this configuration and the use of mysql perl DBI.

My local connection works fine, but once I try to query a remote host db I am getting errors. I know my setup to the remote db works as I can do the following from a shell:

WORKS:

$ mysql -u foo-man -pmypa55w0rd --database abc -h abc123.name.locale --port 3306 -ss -e "select UUID()"  

From using the perl DBI, localhost works too:

my $dbh = DBI->connect("DBI:mysql:database=test;host=localhost:port=3306;user=root");

But using perl DBI, querying a remote database, NO luck.

DOESN'T WORK:

my $dbh = DBI->connect("DBI:mysql:database=abc;host=abc123.name.locale;port=3306;user=foo-man,password=mypa55w0rd"); 

nor using the IP for example:

my $dbh = DBI->connect("DBI:mysql:database=abc;host=123.567.89.10;port=3306;user=foo-man,password=mypa55w0rd");
1
  • 2
    What error message do you get from $DBI::errstr? Commented Feb 25, 2011 at 3:46

1 Answer 1

6

I would use

my $dbh = DBI->connect("DBI:mysql:database=abc;host=abc123.name.locale;port=3306",
                       'foo-man', 'mypa55w0rd');

But it would probably also work if you changed the comma after the username to a semicolon.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.