Beat_88 Posted September 18, 2007 Share Posted September 18, 2007 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. Quote Link to comment https://forums.phpfreaks.com/topic/69804-blog/ Share on other sites More sharing options...
freakstyle Posted September 18, 2007 Share Posted September 18, 2007 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 Quote Link to comment https://forums.phpfreaks.com/topic/69804-blog/#findComment-350686 Share on other sites More sharing options...
Fadion Posted September 19, 2007 Share Posted September 19, 2007 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). Quote Link to comment https://forums.phpfreaks.com/topic/69804-blog/#findComment-350766 Share on other sites More sharing options...
jcbarr Posted September 21, 2007 Share Posted September 21, 2007 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'); Quote Link to comment https://forums.phpfreaks.com/topic/69804-blog/#findComment-352263 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.