Access denied for user 'ODBC'@'localhost'

Discussion in 'PHP' started by Marks & Lesters, Aug 21, 2008.

  1. #1
    Problem:
    It cant display information entered in the databse intead it display an error stated below..

    Error code:
    Warning: mysql_query() [function.mysql-query]: Access denied for user 'ODBC'@'localhost' (using password: NO) in E:\wamp\www\lormahr\employee\view_employee.php on line 486

    On line 486:
    $result=mysql_query($query);

    :confused:
     
    Marks & Lesters, Aug 21, 2008 IP
  2. ryandanielt

    ryandanielt Well-Known Member

    Messages:
    1,797
    Likes Received:
    37
    Best Answers:
    0
    Trophy Points:
    185
    #2
    It is telling you that the error is on line 486 because this line of code was written to print out the results, check to make sure that your database login details are correct and that all tables are stated correctly!
     
    ryandanielt, Aug 21, 2008 IP
  3. Joseph S

    Joseph S Well-Known Member

    Messages:
    1,373
    Likes Received:
    17
    Best Answers:
    0
    Trophy Points:
    155
    #3
    You don`t have the login details set up, that is what that error say.
     
    Joseph S, Aug 21, 2008 IP
  4. Shoro

    Shoro Peon

    Messages:
    143
    Likes Received:
    8
    Best Answers:
    0
    Trophy Points:
    0
    #4
    You need to open a MySQL connection using mysql_connect and select a database using mysql_select_db before you can do queries. For example like this:

    
    $connection = mysql_connect('host', 'username', 'password');
    mysql_select_db('databasename');
    
    PHP:
     
    Shoro, Aug 21, 2008 IP
  5. gameOn

    gameOn Member

    Messages:
    624
    Likes Received:
    8
    Best Answers:
    0
    Trophy Points:
    35
    #5
    This error comes When you have not defined the DB location and credentials or if you have defined them wrong
     
    gameOn, Aug 22, 2008 IP
  6. Freewebspace

    Freewebspace Notable Member

    Messages:
    6,213
    Likes Received:
    370
    Best Answers:
    0
    Trophy Points:
    275
    #6
    Set a password first for your SQL , and also other said make sure you have

    correct database username,password and server...
     
    Freewebspace, Aug 22, 2008 IP
  7. nice.wallpapers

    nice.wallpapers Active Member

    Messages:
    142
    Likes Received:
    3
    Best Answers:
    0
    Trophy Points:
    60
    #7
    Hi,

    this is mysql error, i think your this user "ODBC" don't have permission on localhost please set that first and then try that page again.

    Thanks,
     
    nice.wallpapers, Aug 22, 2008 IP
  8. ghprod

    ghprod Active Member

    Messages:
    1,010
    Likes Received:
    11
    Best Answers:
    0
    Trophy Points:
    78
    #8
    its like u not define user, password and DB ..
     
    ghprod, Aug 22, 2008 IP
  9. cornetofreak

    cornetofreak Peon

    Messages:
    170
    Likes Received:
    6
    Best Answers:
    0
    Trophy Points:
    0
    #9
    i think you are entering your user information in the wrong file due to the fact that ODBC is selected as default user for php unless defined and im sure wamp default user is "root"

    try lookin for where line 486 is and if ites a function or an include or even a var look where the var is created and edit the settings from there?
     
    cornetofreak, Aug 22, 2008 IP
  10. ghprod

    ghprod Active Member

    Messages:
    1,010
    Likes Received:
    11
    Best Answers:
    0
    Trophy Points:
    78
    #10
    any progress Bro?

    Thnx :)
     
    ghprod, Aug 23, 2008 IP