Helpful Information
 
 
Category: PHP / MySQL
newbie q - can't connect

Hello,

I've seen what MySql can do and I'll love to learn it, so I got a book and some tutorials and it seems that I still clueless... I can't even connect to a database :( does anyone knows whats wrong with it:

______________________________
#!/bin/perl

use DBI;

$driver = "DBI:mysql";
$database = "test";

$dbh = DBI -> connect ("$driver:$database", "root", "xxxxxx")
or die "No se pudo establecer la conexion con la base de datos";

$rc = $dbh -> disconnect;

______________________________

Perhaps username, syntax, vars... ????

xIt

What error do you get?
Does the database exist?

Unless you are already familiar with Perl, you may find it easier to start off with PHP/MySQL.

Also do you have phpMyAdmin installed on your account? For that matter do you have MySql installed?


Looking at the database in phpMyAdmin did alot for me to understand things. Could have been all the links to info that I kept clicking on and reading.

Hi!

I choosed perl because I already am a bit familiar with it... and the problem was something really fool: I never specified the type of output (in this case print "Content-type: text/html\n\n"; ) so the server marked error because didn't knew how to show results or something...

Any way thank you guys!

xIt










privacy (GDPR)