access denied www-data
Posted: Mon Nov 02, 2009 7:52 am
Hi Everyone!
I'm new to linux-php-mysql (though I'm not new to programming/developing)... so bear with me!
I installed Ubuntu 9.04, then installed Apache, PHP and MySQL using...
sudo tasksel install lamp-server
I created a php page, and saved in /var/www/. But when I opened the page in firefox, i get the following error message...
Access denied for user 'www'@'localhost'(using password: no) in /var/www/index.php on line 12.
The code for the php page is as follows:
<?php
ini_set("display_errors", 1);
$mysqli = new mysqli("localhost", "root", "mysql1234", "TonyTestDB");
if (mysqli_connect_errno())
die ("Error connecting MySQL: ".mysqli_connect_error());
$sql1 = "call GetUsers()"; //GetUsers is a stored proc in MySQL
$query1 = $mysqli->query($sql1);
$rt = mysql_query($query);
echo "$rt[FName], $rt[SName], $rt[UName], $rt[PWord]<br />";
?>
Any ideas, because I've looked through countless forums to no avail, and this is driving me crazy!
Many thanks in advance,
Tony
I'm new to linux-php-mysql (though I'm not new to programming/developing)... so bear with me!
I installed Ubuntu 9.04, then installed Apache, PHP and MySQL using...
sudo tasksel install lamp-server
I created a php page, and saved in /var/www/. But when I opened the page in firefox, i get the following error message...
Access denied for user 'www'@'localhost'(using password: no) in /var/www/index.php on line 12.
The code for the php page is as follows:
<?php
ini_set("display_errors", 1);
$mysqli = new mysqli("localhost", "root", "mysql1234", "TonyTestDB");
if (mysqli_connect_errno())
die ("Error connecting MySQL: ".mysqli_connect_error());
$sql1 = "call GetUsers()"; //GetUsers is a stored proc in MySQL
$query1 = $mysqli->query($sql1);
$rt = mysql_query($query);
echo "$rt[FName], $rt[SName], $rt[UName], $rt[PWord]<br />";
?>
Any ideas, because I've looked through countless forums to no avail, and this is driving me crazy!
Many thanks in advance,
Tony