logo
Apache Lounge
Webmasters

 

About Forum Index Downloads Search Register Log in RSS X


Keep Server Online

If you find the Apache Lounge, the downloads and overall help useful, please express your satisfaction with a donation.

or

Bitcoin

A donation makes a contribution towards the costs, the time and effort that's going in this site and building.

Thank You! Steffen

Your donations will help to keep this site alive and well, and continuing building binaries. Apache Lounge is not sponsored.
Post new topic   Forum Index -> Coding & Scripting Corner View previous topic :: View next topic
Reply to topic   Topic: Access denied for user 'ODBC'@'localhost'
Author
coldasice



Joined: 02 Jan 2007
Posts: 20

PostPosted: Thu 04 Jan '07 0:45    Post subject: Access denied for user 'ODBC'@'localhost' Reply with quote

now i have evry thing working i think

but when i try to log in on a login script i get...

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


any one know prob?
Back to top
James Blond
Moderator


Joined: 19 Jan 2006
Posts: 7288
Location: Germany, Next to Hamburg

PostPosted: Thu 04 Jan '07 10:13    Post subject: Reply with quote

Hello!
You have to use a user and a password in your script. If you installed mysql without changes use root as user and an empty password.
Back to top
coldasice



Joined: 02 Jan 2007
Posts: 20

PostPosted: Thu 04 Jan '07 10:24    Post subject: Reply with quote

the problem is that the script is set for my user not odbc
Back to top
James Blond
Moderator


Joined: 19 Jan 2006
Posts: 7288
Location: Germany, Next to Hamburg

PostPosted: Thu 04 Jan '07 10:29    Post subject: Reply with quote

please post the relevant part of the script (not the whole script). So I may check it for errors.
Back to top
coldasice



Joined: 02 Jan 2007
Posts: 20

PostPosted: Thu 04 Jan '07 10:30    Post subject: Reply with quote

lets say i have a connect <-- where it connect's to my db and so on..


but when i try to log in it uses odbc and cannot find my table.. Wink
Back to top
James Blond
Moderator


Joined: 19 Jan 2006
Posts: 7288
Location: Germany, Next to Hamburg

PostPosted: Thu 04 Jan '07 14:29    Post subject: Reply with quote

JB wrote:

please post the relevant part of the script (not the whole script). So I may check it for errors.


If you don't post your script how should anyone help? We can not try, cause anyone can't access your local PC Exclamation
Back to top
coldasice



Joined: 02 Jan 2007
Posts: 20

PostPosted: Thu 04 Jan '07 15:53    Post subject: Reply with quote

what u mean?

what part of the scripT?

in my apache it says

apache/2.2.3 (win32) PHP/5.2.0 DAV/2...
Back to top
James Blond
Moderator


Joined: 19 Jan 2006
Posts: 7288
Location: Germany, Next to Hamburg

PostPosted: Thu 04 Jan '07 20:09    Post subject: Reply with quote

e.g.
Code:

....
mysql_pconnect($host, $user, $password)
....
Back to top
coldasice



Joined: 02 Jan 2007
Posts: 20

PostPosted: Fri 05 Jan '07 16:31    Post subject: Reply with quote

connect script

Code:
<?php

include "connect.php";

if (isset($_POST['submit'])) // name of submit button
{
    $player=$_POST['player'];
    $password=$_POST['password'];
    $player=strip_tags($player);
    $password=md5($password);
    $query = "select * from users where playername='$player' and password='$password' and validated='1'";
    $result = mysql_query($query) or die("No te Gusta") ;
    $result2=mysql_fetch_array($result);
    if($result2)
    {
       session_start();
       $_SESSION['player']=$player;
       print "logged in successfully<br><br>";
       print "<A href='index.php'>Go to Admin Panel</a>";
    }
    else
    {
       print "Wrong username or password or non-activated account.";
    }
}

?>


mysql connect script

Code:

<?
parse_str("$QUERY_STRING");

$db = mysql_connect("localhost", "coldasice", "") or die("Could not connect.");
if(!$db)
   die("no db");
if(!mysql_select_db("game",$db))
    die("No database selected.");
if(!get_magic_quotes_gpc())
{
  $_GET = array_map('mysql_real_escape_string', $_GET);
  $_POST = array_map('mysql_real_escape_string', $_POST);
  $_COOKIE = array_map('mysql_real_escape_string', $_COOKIE);
}
else

   $_GET = array_map('stripslashes', $_GET);
   $_POST = array_map('stripslashes', $_POST);
   $_COOKIE = array_map('stripslashes', $_COOKIE);
   $_GET = array_map('mysql_real_escape_string', $_GET);
   $_POST = array_map('mysql_real_escape_string', $_POST);
   $_COOKIE = array_map('mysql_real_escape_string', $_COOKIE);
}

?>
Back to top
James Blond
Moderator


Joined: 19 Jan 2006
Posts: 7288
Location: Germany, Next to Hamburg

PostPosted: Fri 05 Jan '07 17:37    Post subject: Reply with quote

Your script is working fine. I think you are using a wrong user and/or wrong password / user has no access to the database.

Are the permissions correctly set in mysql?
Back to top
coldasice



Joined: 02 Jan 2007
Posts: 20

PostPosted: Fri 05 Jan '07 20:45    Post subject: Reply with quote

yea think so.. Wink

full acess on evry thing.. but i got delete and make new =D

and i made that odbc user..

and it still wouldent find it =D
Back to top


Reply to topic   Topic: Access denied for user 'ODBC'@'localhost' View previous topic :: View next topic
Post new topic   Forum Index -> Coding & Scripting Corner