Wrox Programmer Forums
Go Back   Wrox Programmer Forums > PHP/MySQL > MySQL
MySQL General discussion about the MySQL database.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the MySQL section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
Old March 25th, 2004, 03:43 PM
tys tys is offline
Registered User
Join Date: Aug 2003
Posts: 5
Thanks: 0
Thanked 0 Times in 0 Posts
Default Access Denied

Hello Im having a trouble connecting to MYSQL Serevr.
It keep saying that
"ERROR 1045: Access denied for user: 'ODBC@localhost' (Using password: NO)

It used to say "Access denied ERROR 1045: Access denied for user: myname@localhost(Using password: YES)
What shall I do

I want to reset a new user name and password so how can i do this please?
Thank you

Old March 25th, 2004, 04:49 PM
Authorized User
Join Date: Sep 2003
Posts: 41
Thanks: 0
Thanked 0 Times in 0 Posts

There are a number of things that could be the problem. Have you checked to see if the server is turned on? To do this go to your mysql directory (By default it is C:\mysql) and then type cd bin. After this type mysqladmin ping. If it says something like
mysqladmin: connect to server at 'localhost' failed
error: 'Can't connect to MySQL server on 'localhost' (10061)'
Check that mysqld is running on localhost and that the port is 3306.
You can check this by doing 'telnet localhost 3306'

then the chances are the server is not turned on.

try typing "net start mysql" (If you use Windows NT, 2000 or XP) or mysqld (if you use Windows 95/98/ME.) and then repeating the mysqladmin ping command. if the server is now working it will say mysqld is alive.

Then try going into mysql again with mysql.

Coincidently it is a good idea to either set a password for user the blank user (ODBC@localhost) or remove it completely. You should also set a password for root. If you would like to know how to do this, there is an excellent tutorial at mysql website http://www.mysql.com/documentation/m...unt_Management

HTH (Hope This Helps)

David Thorne, Student
Old December 10th, 2004, 06:18 AM
Registered User
Join Date: Dec 2004
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via AIM to Leviathann Send a message via MSN to Leviathann Send a message via Yahoo to Leviathann

mysqladmin: cennect to server at 'localhost' failed
error: 'Access denied for use 'ODBC'@'localhost' (using password: NO)'

The server is already started but when I try ping or try a test script it gives me the above error. HELP!!!

Old February 15th, 2007, 03:47 AM
Registered User
Join Date: Feb 2007
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts

I was having the same problem.
Here is the code I used to connect to the database:


The above script is saved as db_login.php.

$connection = mysql_connect($db_host, $db_username, $db_password);
if (!$connection){
die ("Could not connect to the database: <br />". mysql_error());
$db_select = mysql_select_db($db_database);
if (!$db_select){
die ("Could not select the database: <br />". mysql_error());

The above script is saved as connect.php.

And I was calling the connection.php file in localhost.Environment is as follows:
Windows XP
WAMP5 (the windows installer for php, mysql and Apache)
Firefox web browser.


I changed the db_login.php as follows to include root as the username:


It worked.

It uses 'ODBC' as the user instead of 'root'.
This only happens in Windows OS.
Old April 6th, 2007, 08:31 AM
Registered User
Join Date: Apr 2007
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via MSN to svlada

Try to include files in other way <That can be problem somethimes>.
If you included file in bad way, some var's cannot be passed to function.
For example :

include ($_SERVER['DOCUMENT_ROOT'] . '/test/db/dbconn.inc');

$_SERVER['DOCUMENT_ROOT'] returns your directory root

Stankovic Vlada

Similar Threads
Thread Thread Starter Forum Replies Last Post
401.3 Access denied due to Access Control List cforsyth .NET Framework 2.0 8 May 28th, 2009 01:56 PM
access is denied shanwaj ASP.NET 1.0 and 1.1 Basics 0 December 28th, 2007 03:04 AM
Access is denied. Ramakrishna General .NET 4 November 30th, 2004 09:05 AM
Access is Denied khautinh General .NET 1 March 26th, 2004 04:44 PM
Access Denied tys MySQL 0 March 25th, 2004 03:46 PM

Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.