pison Posted July 15, 2012 Share Posted July 15, 2012 I've tried this: $dbh = DBI->connect("DBI:mysql:kymercer_obits:[dbserver]", [user], undef, undef); I've put various things in for dbserver and user, but keep getting messages like this: Access denied for user 'kymercer'@'localhost' (using password: NO) In the above example, I'd put 'kymercer' in for user, and 'localhost' as the server. What should I put here to get it to connect? Any help appreciated. Quote Link to comment Share on other sites More sharing options...
Tjoene Posted July 16, 2012 Share Posted July 16, 2012 Try this: #!/usr/bin/perl use strict; use DBI; my $host = "localhost"; my $database = "database1"; my $port = 3307; my $tablename = "table1"; my $user = "userName"; my $pw = "pass"; my $dbh = DBI->connect("DBI:mysql:database=$database;host=$host;port=$port",$user, $pw) or die "Cannot connect to MySQL server\n"; source: http://stackoverflow.com/questions/2248665/perl-script-to-connect-to-mysql-server-port-3307 Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.