I created a user "test1" (which then got the username "debscrof_test1" from CPanel), a password for the user "test2", and then added the user to a new database "testdb" with all priviliges
Then a simple script to connect to the database (as I am trying to locate the source of the errors), as per below:
[PHP]<?php
$dbhost = "localhost";
$dbuser = "debscrof_test1";
$dbpass = "test2";
$conn = mysql_connect($dbhost, $dbuser, $dbpass) or die ('Error connecting to mysql');
$dbname = 'debscrof_testdb';
mysql_select_db($dbname);
?>[/PHP]
Have tried with " and ' around the values, with 127.0.0.1 as the host... still with the same error message:
Warning: mysql_connect() [function.mysql-connect]: Access denied for user 'debscrof'@'localhost' (using password: NO) in /home/debscrof/public_html/testdb.php on line 6
Error connecting to mysql
...any suggestions why I cannot connect? (and why it says password: NO)!
Many thanks