Question:
Problems with "use Mysql" in perl?
heaveyn
2010-06-02 10:13:33 UTC
I am trying to connect to a mysql server through Perl. I am using the code: use Mysql;
However I am getting an error saying that it cannot locate MySQL.pm in @INC.
I presume its a problem with the directories, anyone got any ideas?

Thanks,

N
Three answers:
rbjolly
2010-06-05 07:56:34 UTC
It is difficult to tell if your syntax is correct. If you're using the DBD::mysql package, the syntax to connect is as follows:



use DBI;

$dbh = DBI->connect("DBI:mysql:database=$db; host=$host",

$user, $password, {RaiseError => 1});



If you're using ActiveState Perl, and the mysql package is not installed, you may install it using the following syntax:



ppm install DBI

ppm install DBD::mysql
?
2016-12-05 02:05:34 UTC
"Resolver problemas" additionally the occasion would be: "Me gustan las matemáticas porque soy bueno en RESOLVER PROBLEMAS" or you may say "Me gustan las matemáticas porque soy bueno RESOLVIENDO PROBLEMAS" the two are superb, yet as a effect, i think of the 1st is greater superb than the 2d.
?
2010-06-06 02:11:36 UTC
don\'t know that


This content was originally posted on Y! Answers, a Q&A website that shut down in 2021.
Loading...