albags
06-10-2007, 09:50
Ciao a tutti,
chiedo a tutti di aiutarmi a creare un database su MAC con MAMP su OSX 10.4.10.
Ho creato un file php per la creazione automatica del database, ma non va. Riporto di seguito il file:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>creazione di database</title>
</head>
<body>
<?php
// definizione variabili
$Host = "localhost:8889";
$User = "root";
$Password = "root";
$DBName = "db_prova";
$Link = mysql_connect ($Host, $User, $Password);
if (mysql_create_db ($DBName, $Link)) {
print ("il database, $DBName, è stato creato con successo!<br>\n");
}
else {
print ("il database, $DBName, non è stato creato!<br>\n");
}
mysql_close ($Link);
?>
</body>
</html>
MAMP per connettersi a mysql suggerisce questo:
$link = mysql_connect('localhost:8889', 'root', 'root');
ma mi da il seguente errore:
4
5.0.37)VE8&UZD$,¢'5vuh)2`jv25ÿBad handshake
cosa vuol dire? potete aiutarmi?
su PC funziona tutto alla grande, perchè su MAC no??
Grazie a tutti in anticipo.
Alberto
chiedo a tutti di aiutarmi a creare un database su MAC con MAMP su OSX 10.4.10.
Ho creato un file php per la creazione automatica del database, ma non va. Riporto di seguito il file:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>creazione di database</title>
</head>
<body>
<?php
// definizione variabili
$Host = "localhost:8889";
$User = "root";
$Password = "root";
$DBName = "db_prova";
$Link = mysql_connect ($Host, $User, $Password);
if (mysql_create_db ($DBName, $Link)) {
print ("il database, $DBName, è stato creato con successo!<br>\n");
}
else {
print ("il database, $DBName, non è stato creato!<br>\n");
}
mysql_close ($Link);
?>
</body>
</html>
MAMP per connettersi a mysql suggerisce questo:
$link = mysql_connect('localhost:8889', 'root', 'root');
ma mi da il seguente errore:
4
5.0.37)VE8&UZD$,¢'5vuh)2`jv25ÿBad handshake
cosa vuol dire? potete aiutarmi?
su PC funziona tutto alla grande, perchè su MAC no??
Grazie a tutti in anticipo.
Alberto