Forum Moderators: coopster
I coded it as:
<?php
$sHostName="localhost";
$sUserName="username";
$sPassword="password";
mysql_connect($sHostName,$sUserName,$sPassword) or die (mysql_error());
?>
I tested it and got browser message:
"Warning: mysql_connect(): Access denied for user 'username'@'localhost' (using password: YES) in /var/www/html/test2.php on line 6
Access denied for user 'username'@'localhost' (using password: YES)"
you'll have to provide a valid mysql user details to get connected to mysql server, if its a new installation try username = "root" and password = "" (blank).
or use phpMyAdmin etc to create another username for yourself and then provide that username and password in your code
;)