Warning message: 'old-style' syntax

Thread Solved

Join Date: May 2008
Posts: 30
Reputation: punitdam is an unknown quantity at this point 
Solved Threads: 3
punitdam's Avatar
punitdam punitdam is offline Offline
Light Poster

Warning message: 'old-style' syntax

 
0
  #1
Apr 4th, 2009
I am trying to connect Mysql5.1 from Perl 5.8.8 on RHEL5 as follows:
  1. $dsn="DBI:mysql:database=mysql";
  2. $dbh=DBI->connect($dsn, 'root', 'root', 'mysql',{RaiseError => 1});
When I try to run perl containing above connection, it gets connected to Mysql and fetches data but displays following warning.
DBI->connect using 'old-style' syntax is deprecated and will be an error in future versions
What can be done to remove this warning?

Thanks and Regards
Reply With Quote Quick reply to this message  
Join Date: Mar 2006
Posts: 898
Reputation: KevinADC has a spectacular aura about KevinADC has a spectacular aura about 
Solved Threads: 67
KevinADC's Avatar
KevinADC KevinADC is offline Offline
Practically a Posting Shark

Re: Warning message: 'old-style' syntax

 
0
  #2
Apr 4th, 2009
I don't know, you can try www.perlmonks.com or ask on the dbi modules mailing list (see the DBI module for details)
Reply With Quote Quick reply to this message  
Join Date: Dec 2004
Posts: 2,413
Reputation: Comatose is a jewel in the rough Comatose is a jewel in the rough Comatose is a jewel in the rough Comatose is a jewel in the rough 
Solved Threads: 211
Team Colleague
Comatose's Avatar
Comatose Comatose is offline Offline
Taboo Programmer

Re: Warning message: 'old-style' syntax

 
0
  #3
Apr 4th, 2009
You need to remove the 'mysql' parameter from connect. Should look something like this:
  1. use DBI;
  2.  
  3. $dsn="DBI:mysql:database=mysql";
  4. $dbh=DBI->connect($dsn, 'root', 'root', {RaiseError => 1});
Reply With Quote Quick reply to this message  
Join Date: Jun 2008
Posts: 147
Reputation: GDICommander is an unknown quantity at this point 
Solved Threads: 19
GDICommander's Avatar
GDICommander GDICommander is offline Offline
Junior Poster

Re: Warning message: 'old-style' syntax

 
0
  #4
Apr 5th, 2009
You can do this:

no warnings ;
no warnings 'all' ;
Reply With Quote Quick reply to this message  
Join Date: May 2008
Posts: 30
Reputation: punitdam is an unknown quantity at this point 
Solved Threads: 3
punitdam's Avatar
punitdam punitdam is offline Offline
Light Poster

Re: Warning message: 'old-style' syntax

 
0
  #5
Apr 6th, 2009
Originally Posted by Comatose View Post
You need to remove the 'mysql' parameter from connect. Should look something like this:
  1. use DBI;
  2.  
  3. $dsn="DBI:mysql:database=mysql";
  4. $dbh=DBI->connect($dsn, 'root', 'root', {RaiseError => 1});
Thanks it is working fine now.
Reply With Quote Quick reply to this message  
Reply

This thread has been marked solved.
Perhaps start a new thread instead?
Message:


Thread Tools Search this Thread



About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC