How do i go about accessing/creating a MySQL database from perl. I'm running Solaris 2 (UNIX).
Printable View
How do i go about accessing/creating a MySQL database from perl. I'm running Solaris 2 (UNIX).
good luck, if you find out let me know as I am wondering the samething. I have not seen any programs that do this.
DBI:: is what you want :)
A quick search revealed: http://www.google.com/search?sourcei...nt&q=DBI+mysql
ya that is what I just found out. also cgi.pm is/was used in some cases. I also found out tha tis is pretty much like php
actually they use DBI:DBDPHP Code:my $data_source = "DBI:mysql:$database:$dbserver";
$dbh = DBI->connect($data_source, $dbuser, $dbpass)
|| &error("Can't connect to $data_source: $DBI::errstr.", $0);
DBD is the internal driver that supports DBI (database interface) - going along with the "all software problems can be simplified by adding an extra layer of indirection" :)
CGI.pm is just for the CGI part but I never used it - always used my 5-line parser code and that was all :)
thanks Mike, I never used DBI or any form of it.
Okay, after a little research on CPAN, i've found out the following:
- I will use the DBI module to connect to the database
- I will use the DBD::MySQL driver included in the "msql mysql" package avalible through the DBI help files
Thanks to all that helped, and i hope this will help anyone that needs it