Mysql error

software development

#1

Hi,
I am getting the following mysql error on my pages

"SELECT command denied to user ‘www_data’@‘hypnos.dreamhost.com’ for table ‘newspaper_links’ "

Though I can connect with my username and password from the command line and everything works fine I can run select and other commands.

Appreciate any help in this regards.
Thanks,
mtewari


#2

On your config file are the host server name correct? remember that you can’t use ‘localhost’, also your username is correct? www_data?

mhhh… time to check the code on your pages… can we see a bit?

Regards.


use VICM3 for a full 97USD discount on your first year!


#3

Hi,
Yes I am using the right username and host, I can connect to the same database from command line and can successfully run select command however on the web page I get this error.
My Config file is as follows:


<?php $confg['db_uname'] = "www_data"; //your database username $confg['db_paswd'] = ""; //your database password $confg['db_host'] = "mysql.mydomainname.com"; //usually localhost $confg['db_dbase'] = "mydatabase"; //the database name //$host="localhost"; ######################################################## //create the function to log into the DB function db_login() { global $confg; $link = @mysql_connect($confg['db_host'], $confg['db_uname'], $confg['db_paswd']) or die("Error connecting: " . mysql_error()); @mysql_select_db($confg['db_dbase'], $link); } //function for logging out from the DB function db_logout() { @mysql_close($link); } //$dbh=mysql_connect ("localhost") or die ('I cannot connect to the database because: ' . mysql_error()); //mysql_select_db ("blog") or die('I cannot select the database because: ' . mysql_error()); ?>