[snip]

DBI connect<'test:GJWPP88','Jerry'....>  failed: Access denied for user
'Jerry'@'gjwpp88' <using password: yes> at line 17

[/snip]

I would try your connection from a command line ie. 'mysql -u Jerry -h
GJWPP88 -p'.

The problem is now not with your perl, it is your mysql user permissions.
>From your error, I see that mysqld is running on your local machine. In this
case you should use localhost instead of the actual hostname ie. 'mysql -u
Jerry -h localhost -p' (you can omit the host on this one, it is default).
If this works, you can change the host in your perl script to localhost, and
you should be ready to go.

---
Tom Crimmins
Interface Specialist
Pottawattamie County, Iowa

-----Original Message-----
From: Gerald Preston
Sent: Thursday, January 06, 2005 5:25 AM
To: 'Tom Crimmins'
Cc: mysql@lists.mysql.com
Subject: RE: first time accessing

Tom,

I tried the following:

#!/perl
use warnings;
use strict;
use DBI;

#  my $dbh=DBI->connect( 'DBI:mysql:test:GJWPP88', 'Jerry', 'password' ) or
die "Cannot connect -> gjwpp88!!<br>$DBI::errstr";

#Local Host Name  - GJWPP88
#Local User Name  - Jerry

#database under GJWPP88 - mysql and test

my $driver   = "mysql";
my $server   = "GJWPP88";
my $database = "test";
my $url      = "DBI:$driver:$database:$server";
my $user     = "Jerry";
my $pass     = "password";
 

my $dbh = DBI->connect($url, $user, $pass)
                || die "Couldn't connect to database: " . DBI->errstr;


And I get the following:

DBI connect<'test:GJWPP88','Jerry'....>  failed: Access denied for user
'Jerry'@'gjwpp88' <using password: yes> at line 17

All I am wanting to do is connect and create a new table.

Any ideas?

Thanks,

Jerry

-----Original Message-----
From: Tom Crimmins
Sent: Monday, January 03, 2005 3:52 PM
To: Gerald Preston
Cc: mysql@lists.mysql.com
Subject: RE: first time accessing

Try something like this:

use DBI;
 

my $driver   = "mysql";
my $server   = "myhost";
my $database = "mydb";
my $url      = "DBI:$driver:$database:$server";
my $user     = "username";
my $pass     = "password";
 

my $dbh = DBI->connect($url, $user, $pass)
                || die "Couldn't connect to database: " . DBI->errstr;

Obviously you don't have to make everything a variable, this is just one
possibility.

---
Tom Crimmins
Interface Specialist
Pottawattamie County, Iowa


-----Original Message-----
From: Gerald Preston
Sent: Monday, January 03, 2005 7:40 PM
To: mysql users
Subject: first time accessing

I am making my first attempt to access MySQL with Perl 

 

#!/perl

use warnings;

use strict;

use dbi;

 

  my $dbh=DBI->connect( 'dbi:MySQL, 'user', 'pass' ) or die "Cannot connect
-> !<br>$DBI::errstr";

 

and I get the following error:

 

Can't connect to data source dbi:MySQL, no data driver specified and DBS_DSN
env var not set

 

Any ideas?

 

 

Thanks,

 

Jerry



-- 
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:    http://lists.mysql.com/[EMAIL PROTECTED]

Reply via email to