Author |
|
coldasice
Joined: 02 Jan 2007 Posts: 20
|
Posted: Thu 04 Jan '07 0:45 Post subject: Access denied for user 'ODBC'@'localhost' |
|
|
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: 7371 Location: Germany, Next to Hamburg
|
Posted: Thu 04 Jan '07 10:13 Post subject: |
|
|
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
|
Posted: Thu 04 Jan '07 10:24 Post subject: |
|
|
the problem is that the script is set for my user not odbc |
|
Back to top |
|
James Blond Moderator
Joined: 19 Jan 2006 Posts: 7371 Location: Germany, Next to Hamburg
|
Posted: Thu 04 Jan '07 10:29 Post subject: |
|
|
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
|
Posted: Thu 04 Jan '07 10:30 Post subject: |
|
|
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.. |
|
Back to top |
|
James Blond Moderator
Joined: 19 Jan 2006 Posts: 7371 Location: Germany, Next to Hamburg
|
Posted: Thu 04 Jan '07 14:29 Post subject: |
|
|
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 |
|
Back to top |
|
coldasice
Joined: 02 Jan 2007 Posts: 20
|
Posted: Thu 04 Jan '07 15:53 Post subject: |
|
|
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: 7371 Location: Germany, Next to Hamburg
|
Posted: Thu 04 Jan '07 20:09 Post subject: |
|
|
e.g.
Code: |
....
mysql_pconnect($host, $user, $password)
....
|
|
|
Back to top |
|
coldasice
Joined: 02 Jan 2007 Posts: 20
|
Posted: Fri 05 Jan '07 16:31 Post subject: |
|
|
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: 7371 Location: Germany, Next to Hamburg
|
Posted: Fri 05 Jan '07 17:37 Post subject: |
|
|
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
|
Posted: Fri 05 Jan '07 20:45 Post subject: |
|
|
yea think so..
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 |
|