CGI/Perl Guide | Learning Center | Forums | Advertise | Login
Site Search: in

  Main Index MAIN
INDEX
Search Posts SEARCH
POSTS
Who's Online WHO'S
ONLINE
Log in LOG
IN

Home: Perl Programming Help: Beginner:
DBI Connect

 



Spectre
New User

Jan 5, 2011, 12:49 AM

Post #1 of 1 (315 views)
DBI Connect Can't Post

When I run my script I get the following error message:

DBI connect('user_db:localhost','user_user',...) failed: Access denied for user 'user_user'@'localhost' (using password: YES) at connperl.pl line 14

I know for a fact the password is correct, and the username is correct. What permissions are needed to connect to a MySQL Database. I am running cPanel if this helps, perl version: 5.8.8, connecting using a perl script (of course I am, hehe), syntax is as follows, I have masked my real information for security purposes:


Code
#!/usr/bin/perl 

# PERL MODULES
use DBD::mysql;
use warnings;

# MYSQL CONFIG VARIABLES
$host = "localhost";
$database = "user_db";
$user = "user_user";
$password = "somepasswordotherthanwhatyourereading";

# PERL CONNECT()
$db=DBI->connect("dbi:mysql:$database:$host", $user, $password);


I really wish I knew why this isn't working, also, I set my pl script to 775 per the request of a fellow programmer/friend's advise versus my original 644 permissions, though I am sure that will not affect this.

 
 


Search for (options) Powered by Gossamer Forum v.1.2.0

Web Applications & Managed Hosting Powered by Gossamer Threads
Visit our Mailing List Archives