Re: Can't connect to local host MySQL database
"Vance E. Neff" <[email protected]> Mon, 30 Mar 2009 09:57:14 -0400
| Newsgroups | gmane.comp.db.mysql.perl |
|---|---|
| Organization | Vance's Consulting Co. |
| Message-ID | <[email protected]> |
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
>
>
>
> With that I can connect using DBD from a perl script running from the
> command line. But still not from a CGI script via an Apache Server.
>
> In all cases I have been able to connect using an ODBC connection.
> Here is my connect command:
> ($dbHandle = DBI->connect("DBI:ODBC:$dbSchemaName", $dbUn, $dbPw)
>
> To set up an ODBC connection:
> start --> settings --> control panel -->Administrative tools --> Data
> Sources (ODBC).
>
> Hope this helps.
> Andynic
>
>
> --- On *Sat, 3/28/09, Vance E. Neff /<[email protected]>/* wrote:
>
>
> From: Vance E. Neff <[email protected]>
> Subject: Can't connect to local host MySQL database
> To: [email protected]
> Date: Saturday, March 28, 2009, 3:18 PM
>
> 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
>
>
> -- MySQL Perl Mailing List
> For list archives: http://lists.mysql.com/perl
> To unsubscribe:
> http://lists.mysql.com/[email protected]
>
>
--
MySQL Perl Mailing List
For list archives: http://lists.mysql.com/perl
To unsubscribe: http://lists.mysql.com/[email protected]