Beefy Boxes and Bandwidth Generously Provided by pair Networks
There's more than one way to do things
 
PerlMonks  

Re: DBI::db error I am confused!

by Bod (Parson)
on Jan 03, 2021 at 21:19 UTC ( [id://11126238]=note: print w/replies, xml ) Need Help??


in reply to DBI::db error I am confused!

From the documentation:
"You almost certainly do not need to call this method."

If as you say, the code works elsewhere, my best guess would be that you are using the wrong DB driver for the database you are using. But it's impossible to know for sure without knowing anything about the database and not seeing your code.

Replies are listed 'Best First'.
Re^2: DBI::db error I am confused!
by traincity (Sexton) on Jan 03, 2021 at 21:39 UTC
    Thank you... That is very helpful about the wrong db driver. The on-line running script is using mysql mariadb. I am using mysql workbench on the localhost. I doubt very much that it has anything to do with script or the data. Can anyone give me a hint how to change the driver? I have no idea. Thanks again!

      You're just guessing. Show us the code as 1nickt suggested.

      Can anyone give me a hint how to change the driver?

      The driver is passed to DBI as the first part of the first parameter of the connect method:

      use DBI; use DBD::mysql; my $dbh=DBI->connect("dbi:mysql:$database_schema:localhost:3306",$user +,$pass);
      This is connecting to MySQL which also works for MariaDB. Although there is a DBD::MariaDB but I haven't switched to using it yet.

      I am using mysql workbench on the localhost

      erm...you do know that MySQL Workbench isn't a database don't you???

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others studying the Monastery: (2)
As of 2024-04-26 06:02 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found