Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Page 1 of 2 12 LastLast
Results 1 to 15 of 21
  1. #1
    New to the CF scene
    Join Date
    Jan 2005
    Posts
    7
    Thanks
    0
    Thanked 0 Times in 0 Posts

    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

  • #2
    Regular Coder
    Join Date
    Nov 2004
    Location
    Somewhere over the rainbow
    Posts
    208
    Thanks
    0
    Thanked 0 Times in 0 Posts
    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 :)

  • #3
    New to the CF scene
    Join Date
    Jan 2005
    Posts
    7
    Thanks
    0
    Thanked 0 Times in 0 Posts
    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

  • #4
    Regular Coder
    Join Date
    Nov 2004
    Location
    Somewhere over the rainbow
    Posts
    208
    Thanks
    0
    Thanked 0 Times in 0 Posts
    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 :)

  • #5
    New to the CF scene
    Join Date
    Jan 2005
    Posts
    7
    Thanks
    0
    Thanked 0 Times in 0 Posts
    No there isnt.


    Regards,

    Jay

  • #6
    Mega-ultimate member
    Join Date
    Jun 2002
    Location
    Winona, MN - The land of 10,000 lakes
    Posts
    1,855
    Thanks
    1
    Thanked 45 Times in 42 Posts
    "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.

  • #7
    New to the CF scene
    Join Date
    Jan 2005
    Posts
    7
    Thanks
    0
    Thanked 0 Times in 0 Posts
    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

  • #8
    Regular Coder
    Join Date
    Nov 2004
    Location
    Somewhere over the rainbow
    Posts
    208
    Thanks
    0
    Thanked 0 Times in 0 Posts
    "ODBC"@"localhost" is the default user...

    sorry, i think i just found the error:

    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 :)

  • #9
    New to the CF scene
    Join Date
    Mar 2005
    Posts
    1
    Thanks
    0
    Thanked 0 Times in 0 Posts

    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

  • #10
    New to the CF scene
    Join Date
    Mar 2005
    Posts
    1
    Thanks
    0
    Thanked 0 Times in 0 Posts

    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.

  • #11
    New to the CF scene
    Join Date
    Feb 2006
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts

    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

  • #12
    New to the CF scene
    Join Date
    Feb 2006
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts
    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.

  • #13
    Regular Coder
    Join Date
    Feb 2005
    Location
    Texas
    Posts
    472
    Thanks
    1
    Thanked 0 Times in 0 Posts
    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!

  • #14
    New Coder
    Join Date
    Feb 2006
    Posts
    10
    Thanks
    0
    Thanked 0 Times in 0 Posts
    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
    ?>

  • #15
    New to the CF scene
    Join Date
    Oct 2007
    Posts
    1
    Thanks
    0
    Thanked 0 Times in 0 Posts
    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.


  •  
    Page 1 of 2 12 LastLast

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •