473,545 Members | 1,890 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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

3 New Member
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_testd b';
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'@'loc alhost' (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 3126
mwasif
802 Recognized Expert Contributor
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'@'loc alhost' (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
2658
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: Fatal error: Call to undefined function: mysql_connect() in /var/www/html/testPHP/testMysql.php on line 7 I have mysqld ver 4.0.20 and php 4.2.2...
8
2635
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 mysql_connect() in ... The documentation is unclear to me. It says that mysql support is now built in, but it doesn't work. Google searches say that it's not...
2
1996
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 C:\Inetpub\wwwroot\programs\index.php on line 8 Now, I def know I've configured my php.ini correctly (its literally the same as my XP machine) and I know that mysql works fine with...
5
4139
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 in my browser. This test page just reads a table in mysql and outputs the results. Fatal error: Call to undefined function: mysql_connect() in...
19
8090
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", ""); Warning: mysql_connect(): Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock' (13) in /var/www/html/buildhw.php on line 13
9
7410
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: " . mysql_error()); mysql_select_db("my_dbf") or die("Grr");
14
7690
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 function mysql_connect() in E:\www \mysite\connecttest.php on line 2
4
7823
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 fields Warning: mysql_num_rows(): supplied argument is not a valid MySQL result resource in /home/themepar/public_html/changepass.php on line 34 Sorry...
2
10276
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 D:\Public_Site\multifileupload\welcome_addfiles.php on line 28 ------------------------------------------------------------ i am trying many ways by giving diff...
11
13187
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')", $link2); As far as understand the problem is that $link2 is "not a valid MySQL-
0
7410
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language...
0
7668
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. ...
1
7437
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For...
0
7773
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the...
1
5343
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 presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes...
0
4960
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert...
0
3466
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in...
0
3448
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
1025
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.