473,412 Members | 1,873 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,412 software developers and data experts.

Warning: mysql_connect() [function.mysql-connect]: Access denied for user 'debscrof'@

3
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
Nov 25 '07 #1
1 3112
mwasif
802 Expert 512MB
Have tried with " and ' around the values, with 127.0.0.1 as the host... still with the same error message:
" and ' do not make a difference.

Use mysql_error()
[PHP]$conn = mysql_connect($dbhost, $dbuser, $dbpass) or die ('Error connecting to mysql. Error: '.mysql_error());[/PHP]

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
Did you notice that in the error message it is saying user 'debscrof'@'localhost'. May be are looking into a wrong PHP. Create a new file and use the code you posted above with the modification I have advised.

Run this new PHP file and post back what is the result.
Nov 26 '07 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

7
by: Frogman | last post by:
Hi, I am new to php and I'm testing php connectivity to mysql. I created a php script using the php.net sample. The script uses the mysql_connect method and when I execute it I get the error: ...
8
by: Wilfred Johnson | last post by:
I thought that I'd try php / mysql on windows 2000. I am running php 5.0.0 and it works fine, except when I try to use mysql functions. I get: Fatal error: Call to undefined function...
2
by: Frobinrobin | last post by:
I am running Win2k3 Server and when I try to use the mysql_connect function I am getting an error: Fatal error: Call to undefined function mysql_connect() in...
5
by: Grant Nosbush | last post by:
I have searched the newsgroups and the web trying to solve this problem and just can't get it. Maybe someone will be able to help. I am getting the following error when I try to view a test page...
19
by: Michael | last post by:
Hi, I'm trying to do something which should be very simple - connect to the MySQL database. Here is the call, followed by the error msg. $conn = mysql_connect("localhost", "root", ""); ...
9
by: Petr Vileta | last post by:
Hi, I'm new here and excuse me if this question was be here earlier. I have a simple code <html><body> <?php <?php $link = mysql_connect("localhost", "user", "password") or die("Grr: " ....
14
by: brett | last post by:
I'm running PHP5 on Windows Vista with mysql 5.2. I have a simple php file with <? $dbc = mysql_connect (); ?> When I run the file, I get this error: Fatal error: Call to undefined...
4
by: Ryanlawrence1 | last post by:
Heya, I get these 2 errors: Warning: mysql_num_rows(): supplied argument is not a valid MySQL result resource in /home/themepar/public_html/changepass.php on line 20 You have not entered all the...
2
by: yogitha | last post by:
For the below code i am getting an error like : --------------------------------------------------------------- Warning: fread(): supplied argument is not a valid stream resource in...
11
by: Kurda Yon | last post by:
Hi, I got this warning: mysql_query(): 4 is not a valid MySQL-Link resource. The line which cause this warning is: mysql_query("insert into $tablename (id,priority) values('$id', '0.00')",...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.