Jump to content

Blog


Beat_88

Recommended Posts

I have downloaded a ready script for a blog system with login and everything but I get this message.

 

Warning: mysql_query() [function.mysql-query]: Access denied for user 'ODBC'@'localhost' (using password: NO) in D:\www\index.php on line 6

 

Warning: mysql_query() [function.mysql-query]: A link to the server could not be established in D:\www\index.php on line 6

Cannot get admin

 

I dont know why I get that wrong messeage. I am trying the blog on my own computer with help from wamp because I want to try the blog before I am puttning it in my website.

 

This is the code from index.php

<?

$db = mysql_connect("localhost", "root@localhost", "password") or die("Could not connect.");

if(!$db)

die("no db");

if(!mysql_select_db("blog",$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);

}

?>

 

If you need any more information please just write and I give you more. Please help me I would really like to build a blog on my site.

Link to comment
Share on other sites

hi there,

 

first make sure your Mysql service is running ( you can see the status in the wamp window )

you must create a new database, from what i see it should be called "blog"

most likely you haven't changed the default settings for mysql, so change the following...

 

<?php
// was $db = mysql_connect("localhost", "root@localhost", "password") or die("Could not connect.");

//now :
$db = mysql_connect("localhost", "root@localhost", "") or die("Could not connect.");

 

good luck, hope this helps you out

 

 

Link to comment
Share on other sites

Im guessing this is a privileges problem. If u have access to phpmyadmin u can go to the privileges menu, create a user if there isnt one and grant the required privileges (select, insert, update, delete). Or in the mysql prompt type: "GRANT ALL PRIVILEGES ON *.* to ODBC@localhost" (not sure if its correct anyway).

Link to comment
Share on other sites

First thing to check is the permissions on the user account. If that still doesn't work then you need to use the MySQL command line function.

 

Log in with the root user and password and then use the following command;

 

set password for

user@localhost = OLD_PASSWORD('password');

 

 

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.