|
|
Warning: Mysql_connect() [function.mysql-connect]: Access Denied For User 'debscrof'@'localhost' (using Password: NO)
Have MySQL on a VPS running CPanel
MySQL v4.1.22-standard
Can access MySql fine through CPanel, phpMyAdmin etc all work fine, creating databases, deleting databases, adding users etc
However, when I try to use MySql from a website, it fails
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
$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);
?>
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)!
View Complete Forum Thread with Replies
See Related Forum Messages: Follow the Links Below to View Complete Thread
|
|
|