Go Back   CodingForums.com > :: Server side development > MySQL

Before you post, read our: Rules & Posting Guidelines

Reply
 
Thread Tools Rate Thread
Old 01-21-2005, 04:46 PM   PM User | #1
jbk_1
New to the CF scene

 
Join Date: Jan 2005
Posts: 7
Thanks: 0
Thanked 0 Times in 0 Posts
jbk_1 is an unknown quantity at this point
Access denied for user 'ODBC'@'localhost' (using password: NO)

Hey guys,
I am using windows XP Pro edition. I have installed MySQL version 4.1.9, Apache 2.0 and PHP 4.3.10.

I have been trying to install this chat system called bribble, web address http://www.bribble.com. It accesses MySQL server and then reads/writes to a database in it. However, when I enter the string for connecting to it using php, I get this error "Access denied for user 'ODBC'@'localhost' (using password: NO)". Browsing around a few forums tells me that this is some bug in the newer versions of MySQL. Anyways here is the string in the php file

$db_host = "localhost"; // database host
$db_name = "bribble"; // database name
$db_login = "root"; // database user
$db_pass= "*****"; // database password

This is the code that I have put in another file.

$db = mysql_connect($db_host, $db_login, $db_pass);
mysql_select_db($db_name,$db);

I know for a fact that the MySQL server works fine, the root has been set up with a password that I enter. And then I get the error message. Any ideas for getting round this one?

Regards,

Jay
jbk_1 is offline   Reply With Quote
Old 01-21-2005, 05:11 PM   PM User | #2
Horus Kol
Regular Coder

 
Join Date: Nov 2004
Location: Somewhere over the rainbow
Posts: 208
Thanks: 0
Thanked 0 Times in 0 Posts
Horus Kol is an unknown quantity at this point
I have seen this, and fixed it before - but i can't remember how, I'm afraid...

I'll think about it and get back to you.


as an extra consideration, though - using the "root" user is a security hole...
__________________
Questions are what binds the universe,
Questions lead to answers,
Answers lead to knowledge,
Knowledge leads to wisdom,
Wisdom brings more questions -- Horus Kol, 2004 :)
Horus Kol is offline   Reply With Quote
Old 01-21-2005, 05:30 PM   PM User | #3
jbk_1
New to the CF scene

 
Join Date: Jan 2005
Posts: 7
Thanks: 0
Thanked 0 Times in 0 Posts
jbk_1 is an unknown quantity at this point
Some of the fixes have been to install older versions...but I think thats not really a solution. Also, there was some mention of mysqli_connect instead of mysql_connect thats noticed in PHP 4/5 but I am not quite sure how I go about ensuring this in a windows installation as you need to type in some command.

Anyways, thank you in advance


Regards,

Jay
jbk_1 is offline   Reply With Quote
Old 01-21-2005, 06:19 PM   PM User | #4
Horus Kol
Regular Coder

 
Join Date: Nov 2004
Location: Somewhere over the rainbow
Posts: 208
Thanks: 0
Thanked 0 Times in 0 Posts
Horus Kol is an unknown quantity at this point
if you open the user table and look at the password for the user, is there * character at the start of it?
__________________
Questions are what binds the universe,
Questions lead to answers,
Answers lead to knowledge,
Knowledge leads to wisdom,
Wisdom brings more questions -- Horus Kol, 2004 :)
Horus Kol is offline   Reply With Quote
Old 01-21-2005, 06:25 PM   PM User | #5
jbk_1
New to the CF scene

 
Join Date: Jan 2005
Posts: 7
Thanks: 0
Thanked 0 Times in 0 Posts
jbk_1 is an unknown quantity at this point
No there isnt.


Regards,

Jay
jbk_1 is offline   Reply With Quote
Old 01-21-2005, 11:20 PM   PM User | #6
bcarl314
Mega-ultimate member


 
Join Date: Jun 2002
Location: Winona, MN - The land of 10,000 lakes
Posts: 1,632
Thanks: 1
Thanked 20 Times in 19 Posts
bcarl314 is on a distinguished road
Quote:
"Access denied for user 'ODBC'@'localhost' (using password: NO)"
This message does not seem to go with the code you supplied. My guess is your succesfully connecting with the code you're using, but somewhere else in the script you're trying to connect with the user "ODBC" and no password. Search your code for the string "ODBC" and I'll be you fix the problem.
bcarl314 is offline   Reply With Quote
Old 01-22-2005, 05:40 AM   PM User | #7
jbk_1
New to the CF scene

 
Join Date: Jan 2005
Posts: 7
Thanks: 0
Thanked 0 Times in 0 Posts
jbk_1 is an unknown quantity at this point
I did do that but didnt find any code to do with any user "ODBC". Plus I think that this code is the only place where the connection is made.


Regards,

Jay
jbk_1 is offline   Reply With Quote
Old 01-25-2005, 11:41 AM   PM User | #8
Horus Kol
Regular Coder

 
Join Date: Nov 2004
Location: Somewhere over the rainbow
Posts: 208
Thanks: 0
Thanked 0 Times in 0 Posts
Horus Kol is an unknown quantity at this point
"ODBC"@"localhost" is the default user...

sorry, i think i just found the error:

Quote:
This is the code that I have put in another file.

$db = mysql_connect($db_host, $db_login, $db_pass);
mysql_select_db($db_name,$db);
if those variables are set in a different file, you should be using the GLOBAL array to reference them:

PHP Code:
$db mysql_connect($GLOBALS['db_host'], $GLOBALS['db_login'], $GLOBALS['db_pass']);
mysql_select_db($GLOBALS['db_name'], $db); 
__________________
Questions are what binds the universe,
Questions lead to answers,
Answers lead to knowledge,
Knowledge leads to wisdom,
Wisdom brings more questions -- Horus Kol, 2004 :)
Horus Kol is offline   Reply With Quote
Old 03-07-2005, 08:39 PM   PM User | #9
stunlaw6
New to the CF scene

 
Join Date: Mar 2005
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
stunlaw6 is an unknown quantity at this point
error msg

hi i get that access denied error msg when i just do things like

shell> mysql -u root

and i read the post that asked whether the password for the user had a * in front and i looked at my password and it was *<trashtrash> so what do i do to fix this error?

thanks
brian
stunlaw6 is offline   Reply With Quote
Old 03-23-2005, 10:53 PM   PM User | #10
Cansler
New to the CF scene

 
Join Date: Mar 2005
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Cansler is an unknown quantity at this point
Internet Explorer

Brian, you probably have a root password set. If that is the case, try:

c:\mysql -u root -p

or

c:\mysql -u root --password="yourpassword"

without the quotation marks.
Cansler is offline   Reply With Quote
Old 02-19-2006, 10:38 AM   PM User | #11
mike_png
New to the CF scene

 
Join Date: Feb 2006
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
mike_png is an unknown quantity at this point
same problem as JBK_1 and tried the other solutions but it did not work yet....

Hi Guys,

I have the same problem with JBK_1 and I have been using the same code in the lower versions of PHP(4 series) and MySql (4 series). It's working in those versions, however, not in the versions of PHP 5 and MySql 5(I am also using the latest version of Apache for MySql 5 and PHP 5).
I can access the MySql in the command prompt and manipulate the database but when I am accessing the MySql using the commands of PHP or the PHP Script, I am getting the access denied for user 'ODBC'@'localhost'(using password:NO).
When I tried creating a database using phpmyadmin, It works... I can create a database and manipulate the data(adding and deleting). It is a PHP software, however, the script for connecting and manipulating data from this software is quite techy and I can't decifer it anymore.
Can anyone give us a light from this problem.....

Thanks
mike_png is offline   Reply With Quote
Old 02-19-2006, 10:46 AM   PM User | #12
mike_png
New to the CF scene

 
Join Date: Feb 2006
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
mike_png is an unknown quantity at this point
Hi Guys,

try putting this problem to a search engine (I used Yahoo!) using this sentence: Access denied for user 'ODBC'@'localhost' (using password: NO) .
You will see that there are sites with same problem. No text comming out from their site but only these words and a set of common warning messages from the PHP. I hope they are aware of this.
mike_png is offline   Reply With Quote
Old 02-25-2006, 10:14 PM   PM User | #13
Digger3000
Regular Coder

 
Join Date: Feb 2005
Location: Texas
Posts: 472
Thanks: 1
Thanked 0 Times in 0 Posts
Digger3000 has a little shameless behaviour in the past
Quote:
Originally Posted by Horus Kol
if you open the user table and look at the password for the user, is there * character at the start of it?
I'm having the same problems and there is a * at the start of my password. What does that mean?
__________________
If you're reading this, it may already be too late!
Digger3000 is offline   Reply With Quote
Old 02-26-2006, 03:43 AM   PM User | #14
[_bushido_]
New Coder

 
Join Date: Feb 2006
Posts: 10
Thanks: 0
Thanked 0 Times in 0 Posts
[_bushido_] is an unknown quantity at this point
Quote:
Originally Posted by jbk_1
Hey guys,
I am using windows XP Pro edition. I have installed MySQL version 4.1.9, Apache 2.0 and PHP 4.3.10.

I have been trying to install this chat system called bribble, web address http://www.bribble.com. It accesses MySQL server and then reads/writes to a database in it. However, when I enter the string for connecting to it using php, I get this error "Access denied for user 'ODBC'@'localhost' (using password: NO)". Browsing around a few forums tells me that this is some bug in the newer versions of MySQL. Anyways here is the string in the php file

$db_host = "localhost"; // database host
$db_name = "bribble"; // database name
$db_login = "root"; // database user
$db_pass= "*****"; // database password

This is the code that I have put in another file.

$db = mysql_connect($db_host, $db_login, $db_pass);
mysql_select_db($db_name,$db);

I know for a fact that the MySQL server works fine, the root has been set up with a password that I enter. And then I get the error message. Any ideas for getting round this one?

Regards,

Jay
use single quotes...

PHP Code:
<?php
    $db_host 
'localhost';          // database host
    
$db_name 'bribble';            // database name
    
$db_login 'root';            // database user
    
$db_pass'*****';         // database password
?>
[_bushido_] is offline   Reply With Quote
Old 10-25-2007, 12:05 AM   PM User | #15
varg300
New to the CF scene

 
Join Date: Oct 2007
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
varg300 is an unknown quantity at this point
It is likely that the client is using the old paasword alogaritm. if the SQL server is newer than 4.1 and PHP is older that 5, you will get this problem.

A goos work-around is to change the password alogharitm to the old one.

to do so, open the SQL command line.
type your password.

the promt says MYSQL>

then type in this (The red is what you shall type)


MYSQL> set password for
-> some_user@localhost = OLD_PASSWORD('some_password');



replace some_user and some_password with the username and the password you want.
varg300 is offline   Reply With Quote
Reply

Bookmarks

Jump To Top of Thread


Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 12:18 AM.

Home - Contact Us - Archives - Link to CF - Resources - Top 

Powered by vBulletin® Version 3.8.2
Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.