help: DBI perl mysql dbd-mysql

help: DBI perl mysql dbd-mysql

am 26.08.2003 21:09:58 von John S Brigham

I am unable to get the perl to talk to the mysql.

I wrote an email to Jochen and he courtesouly and promptly replied. He
asked me use this address and to be more specific about the errors I am
seeing. A bit obvious I suppose.

I have been struggling with this for days and days;

John Brigham
Denver, Colorado
mrphysh@juno.com

problems with MySQL. perl DBI DBD-Mysql

errors

>>>>>>>>>>>>>>>>>When the server is started:

c:\mysql\bin\mysqld.exe --console

gives error 30826 11:13:34 InnoDB: Operating system error number 32 in
file operation.
InnoDB: see http://www.innodb.com/ibman.html for installation help.
Innodb: error number 32 means broken pipe
Innodb: see also section 13.2 at http://www.innodb.com/ibman.html
Innodb: about operating system error numbers
Innodb: file name .\ibdata1
InnoDB: file operation call: 'open'.
Innodb: cannot continue operation.



c:\mysql\bin\mysqld

works fine. sometimes this kills my DOS prompt and I have to open
another command window.
The mysql works fine and I am getting familiar with it.





>>>>>>>>>>>this script is to find active database drivers. It seems to
work fine. I have been using it to see if the DBD-mysql is engaged.

#! /perl/bin/perl -w

use DBI;

my @drivers = DBI->available_drivers();

die "no drivers found!\n" unless @drivers;

foreach my $driver (@drivers){
print "Driver: $driver\n";
my @datasources = DBI->data_sources( $driver);
foreach my $datasource ( @datasources ) {
print "\tdata Source is $datasource\n";
}
print "\n";
}
exit;

I type
c:\mysql\bin\wps\perl -w whatdbd.pl

and get

Driver: ExampleP
data source is dbi:Examplep:dir=.

Driver:proxy
install_driver (proxy)failed: can't locate RPC/Plclient.pm in @inc (@inc
contains: E:/perl/lib E:/perl/site/lib .) at
E:/perl/site/lib/DBD/proxy.pm line 28.
BEGIN failed--compilation aborted at E:/perl/site/lib/DBD/Proxy.pm line
28.
Compliation failed in require at (eval 2) line 3.
Perhaps a module that DBD::Proxy requires hasn't been fully installed at
whatdbd.pl line 11

>>>>>>>>>This is the perl script which I use against the mysql. I have
tried endless variations to no avail.

#! /usr/bin/perl -w

use DBI;

$database="meetageek";
$driver = "DBI:mysql";
my $dbh = DBI->connect($driver:database=$database,
"root","mrphysh") or die "cannot connect";

#insert the values
$dbh->do("INSERT INTO Customers (First_Name,Last_Name)
VALUES ('Rene','Robertson')");
$dbh->do("INSERT INTO Customers (First_Name,Last_Name)
VALUES ('Larry','Isaacson')");
$dbh->do("INSERT INTO Customers (First_Name,Last_Name)
VALUES ('Mark','Harrison')");

#Dissconnect from Database

$dbh ->disconnect;

This is typical of the error I see:

Unquoted string "database" may clash with future reserved word at
firstscript line 7.
syntax error at firstscript.pl line 7 near "$driver:"
execution of firstscript.pl aborted due to compilation errors.

>>>>>>>>>. I have tired endless variations. This one is called 5script.pl

#! /usr/bin/perl -w

use DBI;

$database="meetageek";
$driver = "DBI:mysql";
my $dbh = DBI->connect("DBI::mysql:meetageek","root","myphysh") ;

#insert the values
$dbh->do (INSERT INTO Customers VALUES
'Rene','Robertson');

#Dissconnect from Database

$dbh ->disconnect;

it gives this error:
name "main::database" used only once: possilbe typo at 5script.pl line
5.
name "main::driver" used only once: possible typo at 5script.pl line 6.
Can't connect (DBI::mysql:meetageek root mrphysh), no database driver
specified and DBI_)DSN env var not set at 5script.pl line7.

xxxxxxxxxxxxxxxxxxxxx
I have tried reloading all the software. I have tried different ppm
packages. I have endlessly used ppm to install and uninstall.

I have Active perl version 1.37 5.8.0.806MySQL version 4.0.14

windows 2000
pentium II
256 RAM
My compac has an E: drive and the perl seems to install there by default.

I am committed to this and stuck!

thanks
john brigham
2020 Vine Street
Denver CO 80205
303-333-3266
mrphysh@juno.com

____________________________________________________________ ____
The best thing to hit the internet in years - Juno SpeedBand!
Surf the web up to FIVE TIMES FASTER!
Only $14.95/ month - visit www.juno.com to sign up today!

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

Re: DBI perl mysql dbd-mysql

am 26.08.2003 22:38:51 von Hans van Harten

John S Brigham wrote:
>>> When the server is started:
> c:\mysql\bin\mysqld.exe --console
> gives error 30826 11:13:34 InnoDB: Operating system error number
> 32 in file operation.
That's 'The process cannot access the file because it is being used by
another process. ERROR_SHARING_VIOLATION'
Most likely another instance of mysqld is already running, might as well be
a service!

> InnoDB: see http://www.innodb.com/ibman.html for installation help.
> Innodb: error number 32 means broken pipe
> Innodb: see also section 13.2 at http://www.innodb.com/ibman.html
> Innodb: about operating system error numbers
> Innodb: file name .\ibdata1
> InnoDB: file operation call: 'open'.
> Innodb: cannot continue operation.

> c:\mysql\bin\mysqld
> works fine. sometimes this kills my DOS prompt and I have to
> open another command window.
You manually started mysql-server, not as a service, but as a program that
does not take a key for input ;-).
If the command does fall back to the prompt, something went wrong and the
program did not start at all!.

You should have installed MySQL as a server in the first place.

> The mysql works fine and I am getting familiar with it.
Try MySQLcc too!!

>>> this script is to find active database drivers. It seems to work fine.
>>> I have been using it to see if the DBD-mysql is engaged.
> Driver:proxy
> install_driver (proxy)failed: can't locate RPC/Plclient.pm in @inc
> (@inc contains: E:/perl/lib E:/perl/site/lib .) at
> E:/perl/site/lib/DBD/proxy.pm line 28.
> BEGIN failed--compilation aborted at E:/perl/site/lib/DBD/Proxy.pm
> line 28.
> Compliation failed in require at (eval 2) line 3.
> Perhaps a module that DBD::Proxy requires hasn't been fully installed
> at whatdbd.pl line 11
You just need to run 'ppm install plrpc' to fulfill a dependancy.

>>> This is the perl script which I use against the mysql.
>>> I have tried endless variations to no avail.
> #! /usr/bin/perl -w
> use DBI;
> $database="meetageek";
> $driver = "DBI:mysql";
> my $dbh = DBI->connect($driver:database=$database,
> "root","mrphysh") or die "cannot connect";
Cause: Look like Perl is trying to make 'something' equal to $database ...
... and DBI does not take TRUE or FALSE as an argument.
Remedy: Use double quotes at the first parameter of DBI->connect
'my $dbh = DBI->connect("$driver:database=$database","root","mrphysh") or
die "cannot connect";'
[]

> #! /usr/bin/perl -w
> use DBI;
> $database="meetageek";
> $driver = "DBI:mysql";
> my $dbh = DBI->connect("DBI::mysql:meetageek","root","myphysh") ;
> #insert the values
> $dbh->do (INSERT INTO Customers VALUES
> 'Rene','Robertson');
> #Dissconnect from Database
> $dbh ->disconnect;
> it gives this error:
> name "main::database" used only once: possilbe typo at 5script.pl
> line 5.
> name "main::driver" used only once: possible typo at 5script.pl line
Just friendly warning due to '-w' in '> #! /usr/bin/perl -w'

> 6. Can't connect (DBI::mysql:meetageek root mrphysh), no database
> driver specified and DBI_)DSN env var not set at 5script.pl line7.
Missing the 'database=' phrase:
my $dbh = DBI->connect("$driver:database=$database",
"root","mrphysh") or die "cannot connect";

> xxxxxxxxxxxxxxxxxxxxx
> I have tried reloading all the software. I have tried different ppm
> packages. I have endlessly used ppm to install and uninstall.
>
> I have Active perl version 1.37 5.8.0.806MySQL version 4.0.14
>
> windows 2000
> pentium II
> 256 RAM
> My compac has an E: drive and the perl seems to install there by
> default.
You _can_ overwrite that default if you want to,
just _read_ before pressing enter

> I am committed to this and stuck!
Good luck

HansH


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

Re: DBI perl mysql dbd-mysql

am 26.08.2003 22:38:51 von Hans van Harten

John S Brigham wrote:
>>> When the server is started:
> c:\mysql\bin\mysqld.exe --console
> gives error 30826 11:13:34 InnoDB: Operating system error number
> 32 in file operation.
That's 'The process cannot access the file because it is being used by
another process. ERROR_SHARING_VIOLATION'
Most likely another instance of mysqld is already running, might as well be
a service!

> InnoDB: see http://www.innodb.com/ibman.html for installation help.
> Innodb: error number 32 means broken pipe
> Innodb: see also section 13.2 at http://www.innodb.com/ibman.html
> Innodb: about operating system error numbers
> Innodb: file name .\ibdata1
> InnoDB: file operation call: 'open'.
> Innodb: cannot continue operation.

> c:\mysql\bin\mysqld
> works fine. sometimes this kills my DOS prompt and I have to
> open another command window.
You manually started mysql-server, not as a service, but as a program that
does not take a key for input ;-).
If the command does fall back to the prompt, something went wrong and the
program did not start at all!.

You should have installed MySQL as a server in the first place.

> The mysql works fine and I am getting familiar with it.
Try MySQLcc too!!

>>> this script is to find active database drivers. It seems to work fine.
>>> I have been using it to see if the DBD-mysql is engaged.
> Driver:proxy
> install_driver (proxy)failed: can't locate RPC/Plclient.pm in @inc
> (@inc contains: E:/perl/lib E:/perl/site/lib .) at
> E:/perl/site/lib/DBD/proxy.pm line 28.
> BEGIN failed--compilation aborted at E:/perl/site/lib/DBD/Proxy.pm
> line 28.
> Compliation failed in require at (eval 2) line 3.
> Perhaps a module that DBD::Proxy requires hasn't been fully installed
> at whatdbd.pl line 11
You just need to run 'ppm install plrpc' to fulfill a dependancy.

>>> This is the perl script which I use against the mysql.
>>> I have tried endless variations to no avail.
> #! /usr/bin/perl -w
> use DBI;
> $database="meetageek";
> $driver = "DBI:mysql";
> my $dbh = DBI->connect($driver:database=$database,
> "root","mrphysh") or die "cannot connect";
Cause: Look like Perl is trying to make 'something' equal to $database ...
... and DBI does not take TRUE or FALSE as an argument.
Remedy: Use double quotes at the first parameter of DBI->connect
'my $dbh = DBI->connect("$driver:database=$database","root","mrphysh") or
die "cannot connect";'
[]

> #! /usr/bin/perl -w
> use DBI;
> $database="meetageek";
> $driver = "DBI:mysql";
> my $dbh = DBI->connect("DBI::mysql:meetageek","root","myphysh") ;
> #insert the values
> $dbh->do (INSERT INTO Customers VALUES
> 'Rene','Robertson');
> #Dissconnect from Database
> $dbh ->disconnect;
> it gives this error:
> name "main::database" used only once: possilbe typo at 5script.pl
> line 5.
> name "main::driver" used only once: possible typo at 5script.pl line
Just friendly warning due to '-w' in '> #! /usr/bin/perl -w'

> 6. Can't connect (DBI::mysql:meetageek root mrphysh), no database
> driver specified and DBI_)DSN env var not set at 5script.pl line7.
Missing the 'database=' phrase:
my $dbh = DBI->connect("$driver:database=$database",
"root","mrphysh") or die "cannot connect";

> xxxxxxxxxxxxxxxxxxxxx
> I have tried reloading all the software. I have tried different ppm
> packages. I have endlessly used ppm to install and uninstall.
>
> I have Active perl version 1.37 5.8.0.806MySQL version 4.0.14
>
> windows 2000
> pentium II
> 256 RAM
> My compac has an E: drive and the perl seems to install there by
> default.
You _can_ overwrite that default if you want to,
just _read_ before pressing enter

> I am committed to this and stuck!
Good luck

HansH


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