吴连连 | 17 Mar 01:29 2009
Picon

RE: DBD::mysql for Windows XP Professional


Hi Andy,

I tried ppm install DBD-mysqlPP, it works. Looks like PPM only provide the DBD-mysqlPP if you check.

> Date: Thu, 26 Feb 2009 08:36:42 -0800
> Subject: Re: DBD::mysql for Windows XP Professional
> From: mussatto <at> csz.com
> To: perl <at> lists.mysql.com
> 
> On Wed, February 25, 2009 12:38, Andy wrote:
> > Hi,
> >
> >
> >
> > I am running Perl (please see result of "perl -v" at the end of this
> > e-mail).
> try install DBD-mysql seemed to work for me. The key is the '::' is
> replaced by '-' when you do the stuff under ppm
> >
> > I am using the following version of MySQL:
> >
> > Server version: 5.1.31-community MySQL Community Server (GPL)
> >
> >
> >
> > I would like to be able to connect to the database from a perl script.
> >
> >
> >
(Continue reading)

Damon Abruzere | 20 Mar 21:43 2009

DBD::mysql on Windows 2008 Server x64

I can't figure out how to get dbd-mysql or DBD::mysql to install on my Windows Server 2008 64bit box...

Here's a referenced Forum I've been using to try to solicit an answer if it helps.
http://forums.movabletype.org/2009/03/installation-problem-with-dbdmysql.html

Here's my setup...

Server:
- Windows 2008 Server x64 Enterprise Edition
- IIS 7

ActiveState ActivePerl - 5.10.0.1004
- which, as I've found out does not have ppm gui for x64 yet...
- I'm using the CLI

MySQL Server - 5.1.32

MovableType - 4.24-en

____________________________________________________________
So, I've even downloaded the source files from CPAN

"DBD-mysql-4.010.tar.gz"

- I unpacked them in to a local folder...

and I've tried 2 different methods to get it to install.

____________________________________________________________
(1) Add the package to ppm
(Continue reading)

Vance E. Neff | 28 Mar 15:18 2009

Can't connect to local host MySQL database

Hello,

I'm having trouble connecting to my MySQL database on a Windows XP SP2 
system via Perl.

use DBI;
use DBD::mysql;

Can't connect to MySQL server on 'localhost' (10061) at ... this statement:
our $dbh = 
DBI->connect("dbi:mysql:database=test;host=localhost;port=3306","root","") 
|| die "could not open CNCJobs.MySQL database! $DBI::errstr";

Note that the above line probably wrapped.

Version info:
perl version v5.10.0 built for MSWin32-x86-mulit-thread by ActiveState
MySQL Server version: 5.1.32-community
DBI::VERSION = 1.607
DBD::mysql::VERSION = 4.005

I am able to use the MySQL Command line statement:
mysql -u root -h localhost test.
and can successfully use a select query on the database.

Any ideas?

Vance

--

-- 
(Continue reading)

Vance E. Neff | 29 Mar 17:04 2009

Re: Can't connect to local host MySQL database

Hans,

Thank you for your response!

I tried:
CREATE USER 'CNCJobs' <at> '%' IDENTIFIED BY '1a2b3c';
GRANT ALL PRIVILEGES ON *.* TO 'CNCJobs' <at> '%' WITH GRANT OPTION;
adn then:
our $dbh = 
DBI->connect("dbi:mysql:database=test;host=localhost;port=3306","CNCJobs","1a2b3c") 
|| die "could not open CNCJobs.MySQL database! $DBI::errstr";

I then tried:
CREATE USER 'CNCJobs' <at> 'localhost' IDENTIFIED BY '1a2b3c';
GRANT ALL PRIVILEGES ON *.* TO 'CNCJobs' <at> 'localhost' WITH GRANT OPTION;
and then:
our $dbh = 
DBI->connect("dbi:mysql:database=test;host=localhost;port=3306","CNCJobs","1a2b3c") 
|| die "could not open CNCJobs.MySQL database! $DBI::errstr";

and finally I tried (your original suggestion):
GRANT SELECT ON test.* TO testuser <at> localhost IDENTIFIED BY '1a2b3c';
and then:
our $dbh = 
DBI->connect("dbi:mysql:database=test;host=localhost;port=3306","testuser","1a2b3c") 
|| die "could not open CNCJobs.MySQL database! $DBI::errstr";
and also:
our $dbh = 
DBI->connect("DBI:mysql:database=test;host=localhost;port=3306","CNCJobs","1a2b3c") 
|| die "could not open CNCJobs.MySQL database! $DBI::errstr";
(Continue reading)

Mr Greg Meckes | 29 Mar 20:13 2009
Picon

Re: Can't connect to local host MySQL database


Make sure that after all that, you type flush privledges. 

Greg

Sent from iPhone. 

On Mar 29, 2009, at 11:04 AM, "Vance E. Neff" <veneff <at> intouchmi.com> wrote:

Hans,

Thank you for your response!

I tried:
CREATE USER 'CNCJobs' <at> '%' IDENTIFIED BY '1a2b3c';
GRANT ALL PRIVILEGES ON *.* TO 'CNCJobs' <at> '%' WITH GRANT OPTION;
adn then:
our $dbh =
DBI->connect("dbi:mysql:database=test;host=localhost;port=3306","CNCJobs","1a2b3c") || die
"could not open CNCJobs.MySQL database! $DBI::errstr";

I then tried:
CREATE USER 'CNCJobs' <at> 'localhost' IDENTIFIED BY '1a2b3c';
GRANT ALL PRIVILEGES ON *.* TO 'CNCJobs' <at> 'localhost' WITH GRANT OPTION;
and then:
our $dbh =
DBI->connect("dbi:mysql:database=test;host=localhost;port=3306","CNCJobs","1a2b3c") || die
"could not open CNCJobs.MySQL database! $DBI::errstr";

and finally I tried (your original suggestion):
(Continue reading)

Vance E. Neff | 30 Mar 15:57 2009

Re: Can't connect to local host MySQL database

Andynic,

Thank you so much!

I had to download the MySQL/odbc connector and discovered that I had to 
force use of named pipes for localhost when configuring it even though 
it never asked me what that pipe name is.
But, I can now connect to my database via perl.
I wonder if pipes have anything to do with the dbi::mysql connection 
problem.

Anyway, thank you again!
Vance

andynic wrote:
> Hi Vance,
>  
> I have also had problems connecting.
>  
> Am using the sam versions as you (though I'm not sure about the DBD 
> version).  This is the way I finally successfully installed DBD.
>
> Installing DBD for Perl 5 (command all on one line)
>
> ppm install http://cpan.uwinnipeg.ca/PPMPackages/10xx/ 
> <http://cpan.uwinnipeg.ca/PPMPackages/10xx/DBD-mysql.ppd>DBD-mysql 
> <http://cpan.uwinnipeg.ca/dist/DBD-mysql>.ppd
>
>  
>  
(Continue reading)

Vance E. Neff | 31 Mar 17:49 2009

Trying to get the last inserted ID

Hello,

I have inserted a new row into a table that has an auto incrementing key.

For some reason, I don't seem to be able to retrieve it after it is created.
I tried these two statements:
$LoginID = $dbh->last_insert_id( "", "", "Logins", "LoginID" );
and
$LoginID = $dbh->{'mysql_insertid'};

in both cases, $LoginID comes back undefined.
I tried before the COMMIT and after with the same results.  Note that 
auto commit is currently turned on, so my commits should have anything 
to do with anything.

What am I doing wrong?

Note that I have verified that the key is being created with the 
expected values.

Vance

--

-- 
MySQL Perl Mailing List
For list archives: http://lists.mysql.com/perl
To unsubscribe:    http://lists.mysql.com/perl?unsub=gcdmp-msql-mysql-modules <at> m.gmane.org

Michael R Boudreau | 31 Mar 18:26 2009

Re: Trying to get the last inserted ID

According to "Programming the Perl DBI" (O'Reilly 2000), the syntax varies depending on your version of DBD::mysql:

If you used a prepare/execute:

$sth->{mysql_insertid}  (1.21_xx)
$sth->{insertid} (1.20_xx)

If you used $dbh->do:

$dbh->{mysql_insertid}  (1.21_xx)
$dbh->do("SELECT LAST_INSERT_ID()")  (1.20_xx)

On 3/31/09 10:49 AM, "Vance E. Neff" <veneff <at> intouchmi.com> wrote:

Hello,

I have inserted a new row into a table that has an auto incrementing key.

For some reason, I don't seem to be able to retrieve it after it is created.
I tried these two statements:
$LoginID = $dbh->last_insert_id( "", "", "Logins", "LoginID" );
and
$LoginID = $dbh->{'mysql_insertid'};

in both cases, $LoginID comes back undefined.
I tried before the COMMIT and after with the same results.  Note that
auto commit is currently turned on, so my commits should have anything
to do with anything.

What am I doing wrong?
(Continue reading)


Gmane