473,756 Members | 4,640 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Access denied for user 'ODBC'@'localho st' (using password: NO)

232 New Member
i hav downloaded php script from a site but while running it gives error
Access denied for user 'ODBC'@'localho st' (using password: NO) in C:\wamp\www\for um\db.class.inc .php on line 29
i use this for my connection and works well
$conn=mysql_con nect("localhost ","root","" );
while this doesnt work
function db($localhost=' localhost',$dat abase='ncstd',$ username='root' ,$password='')

kindly help as i m new to php
Aug 26 '09 #1
7 6558
Dormilich
8,658 Recognized Expert Moderator Expert
@kkshansid
then you should check, whether db() works correctly.
Aug 26 '09 #2
kkshansid
232 New Member
Expand|Select|Wrap|Line Numbers
  1. function db($localhost='localhost',$database='ncpul1',$username='root',$password=''){
  2.         $this->localhost=$localhost;
  3.         $this->database=$database;
  4.         $this->username=$username;
  5.         $this->password=$password;
  6.         $this->conn=mysql_connect($this->localhost,$this->username,$this->password);//line29
  7.         mysql_select_db($this->database,$this->conn);
  8.     }
i dont think there is any error in this function
Aug 26 '09 #3
Dormilich
8,658 Recognized Expert Moderator Expert
just to make sure… how do you call db()?
Aug 26 '09 #4
kkshansid
232 New Member
on index page after including connection file function call as
Expand|Select|Wrap|Line Numbers
  1. $db=new db($DB_LOCALHOST,$DB_DATABASE,$DB_USERNAME,$DB_PASSWORD);
Aug 26 '09 #5
Dormilich
8,658 Recognized Expert Moderator Expert
is $DB_USERNAME a variable or a constant?
Aug 26 '09 #6
Markus
6,050 Recognized Expert Expert
In your first example, you say it works when user = root. However, the error is saying that you're connecting as 'ODBC' (I assume that's no username). So you're doing something wrong.
Aug 26 '09 #7
Dormilich
8,658 Recognized Expert Moderator Expert
I suspect that’s the username used when no username ("", null) was given. if the username is indeed saved as DB_USERNAME (you* hardly name variables uppercase) it would be the explanation.

* at least the ones who read the naming convention
Aug 26 '09 #8

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

Similar topics

33
106544
by: Savas Ates | last post by:
in asp page im getting this error how can i solve it.. yesterday the codes work but i setup visual studio 6.0 now it doesnt works..
0
3395
by: Ryan Schefke | last post by:
------=_NextPart_000_0077_01C34C8B.2B90C960 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit ..I just sent this out to the win32 distribution list but no one has replied.can someone on this list please help? The issue should be trivial for experienced MySQL users, I'm just a novice, thanks!
0
12034
by: Ike_strong | last post by:
Can anyone help me to figure out why each time I try to access my database using: c:\mysql\bin\inmysql -root -p and afterwards:(i.e. after inputting my at the password prompt) Enter Password: '******' I get the following:
0
1625
by: greg_s_007 | last post by:
Just wanted to share a solution I found to this common problem that I have not yet seen posted. I am in the process of migrating an application from NT/IIS 4.0/SQL 6.5 to Win2003. The SQL server and ASP web application are on separate servers in an NT domain. While migrating the web app to a Windows 2003 server (which is not in the domain), I was unable to connect to the database via ODBC using named pipes.
3
4915
by: Xerxes | last post by:
Hi, I would like to import the tables from MySQL database into Access database and I am not sure how to go about it. I tired to "Import External Data" from Access, selected "ODBC database" from file type dropdown, selected "New data source" and picked SQL Server from the list. I specified the server name (mydomain.com) along with user id and password. But when I clicked on "Next", I got: "connection failed: SQL Server Error:10060,...
6
4141
by: ASP.Confused | last post by:
I have an ASP.NET page writtein in VB that uses ADODB. I just had to force-install MDAC 2.8 after I tried to rollback to 2.6 (my web host uses this, and I wanted to be compatible with them.) I had to manually install all of the ODBC drivers and the rest of the DLL's, and now I am getting "Access is Denied" errors on any page that uses ADODB. How do I fix it? I already gave the ODBC drivers in the folders in "c:\program files\common...
0
3537
by: ASP.Confused | last post by:
The old message looked a little stale, so I am re-posting it here. Anybody have any ideas of what I could do?!? The previous responses to this question are below. If you want to look at the original question, the subject line is: ADODB.NET and "Access Denied" I have an ASP.NET page writtein in VB that uses ADODB. I just had to
2
74716
by: SKB | last post by:
Hi, I am absolutely new to this area. I am getting the following difficulty : Access denied for user 'ODBC'@'localhost' (using password: NO) when I try the mysql command from within the C:\Program Files\MySQL\MySQL Server 5.0\bin on the command window. Please note that the MySQL is runnging as I have tried the command NET START MySQL and it gives the following output: The requested service has already been started. More help is...
14
2804
by: jolinlim | last post by:
Warning: mysql_connect(): Access denied for user: 'ODBC@localhost' (Using password: NO) in c:\appserv\www\sql.php on line 12 Warning: mysql_select_db(): supplied argument is not a valid MySQL-Link resource in c:\appserv\www\sql.php on line 13 Warning: mysql_query(): Access denied for user: 'ODBC@localhost' (Using password: NO) in c:\appserv\www\sql.php on line 14 Warning: mysql_query(): A link to the server could not be established in...
5
9138
by: lisles | last post by:
i have a page funtion.php which hs the function to connect to the db /* Mysql Connection */ function connect(){ global $db_server,$db_user,$db_pass,$db;//Global Values from the config.php $conn = @mysql_connect($db_server,$db_user,$db_pass) or die("Connection to Database Server Failed"); @mysql_select_db($db) or die("Database Selection Failed"); return $conn; }
0
9456
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9275
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 synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
9873
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
9846
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 most users, this new feature is actually very convenient. If you want to control the update process,...
0
8713
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7248
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 instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5142
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 the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5304
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
3359
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.