Beefy Boxes and Bandwidth Generously Provided by pair Networks
Just another Perl shrine

Re: how perl can connect with mysql

by cchampion (Curate)
on Jan 09, 2005 at 11:37 UTC ( #420670=note: print w/replies, xml ) Need Help??

in reply to how perl can connect with mysql

You need at least two things:

  • a colon (:) between "mysql" and "test1". It seems there is a strange character instead (that was before you updated your code).
  • An appropriate driver (DBD::mysql), without which the DBI can't know which DBMS it should talk to.
    If you want to know if the driver is already installed, use this line:
    $ perl -MDBD::mysql -e 1
    If no error is returned, then you have the right module installed. If you get an error message, you should install it.


Replies are listed 'Best First'.
Re^2: how perl can connect with mysql
by biofeng918 (Acolyte) on Jan 09, 2005 at 13:05 UTC
    I have installed the DBD-mysql by the way of internet. So it should be the most appropiate one for this version perl.

      So now you have amended your code and made sure that the DBD module is installed.

      Did you try again running the code?

      If yes, does it work?

      If not, does it give you any messages?

      Help us to help you. Please read (and practice) Before asking a database related question ....

      Oh, BTW, (I forgot the Monastery mantra)
      use strict and warnings, and a lot of errors will fall in you net without much effort.

        I have run the code after amending, but it still didnot work,it says that syntax eeror at line8 near "insert itnto insert into mytable (name,sex,birth,birthaddr)" and ( might be a runaway multi-line >> string starting on line4) ,unmatched right curly bracket at line8,at end of line. So this is all I know now,thank you again.

Log In?

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://420670]
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others imbibing at the Monastery: (1)
As of 2023-09-26 22:05 GMT
Find Nodes?
    Voting Booth?

    No recent polls found