General SQL Development
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
 
User Name:
Password:
Remember me
 
Go Back   Dev Articles Community ForumsDatabasesGeneral SQL Development

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Display Modes
 
Unread Dev Articles Community Forums Sponsor:
  #1  
Old February 25th, 2003, 06:20 AM
kb31 kb31 is offline
Junior Member
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Nov 2002
Posts: 12 kb31 User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
switching from localhost to a server

HI
I have been playing around with a small message board I have it running perfectly on my system under localhost, but on uploading to my domain I recieve the following error messages.

Warning: Access denied for user: 'apache@localhost' (Using password: NO) in /var/www/html/www.xxxxxxxx.net/treenode_class.php on line 38

Warning: MySQL Connection Failed: Access denied for user: 'apache@localhost' (Using password: NO)

in /var/www/html/xxxxxxxx.net/treenode_class.php on line 38

Warning: MySQL: A link to the server could not be established in

/var/www/html/www.xxxxxxxx.net/treenode_class.php on line 38


this is my line 37 and 38 from that script:

line 37 $query = "select * from header where parent = $postid order by posted";
line 38 $result = mysql_query($query);

1) could these messages be triggered if I have register globals on and my server has them off?

2) I am using apache 2.0.39 and the server using 1.3.27?

3) I have this running on win XP the server is running redhat linux, though my standard html pages do run successfully on the server.

4) I am quite a novice with mysql and php so any advice would be welcomed.

I know the server has disabled %localhost but I am using my own login details and as far as I know am not calling apache@localhost.

I have been granted access via phpmysqladmin to the total mysql setup on the server, but being a novice reluctant to do very much in there.

this is the function I am using

<?

function db_connect()
{
$result = @mysql_pconnect("localhost", "discussion", "password");
if (!$result)
return false;
if (!@mysql_select_db("discussion"))
return false;

return $result;
}

?>

PS as some extra info: I am in australia and the server is in canada, I have been granted 3 domains on this server at no cost. They have recently in last 12 months gone from a windows 2000
server to linux, they installed mysql and php mainly for my benefit and maybe they don't know or

don't have their server configured to suit my requirements or maybe mine isn't suitable to theirs.I am also using Dreamweaver MX.

thankyou.

Reply With Quote
  #2  
Old February 25th, 2003, 08:55 AM
ramz ramz is offline
Contributing User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Jan 2003
Location: Juiz de Fora - MG- Brazil
Posts: 93 ramz User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 6
Send a message via ICQ to ramz Send a message via MSN to ramz
Hi!
Try to put at the host parameter the IP or the domain for the MySQL server, like in the example:
IP: 192.168.0.1 (it's not real, just an example...)
Domain: mysql.server.com

And try using your password too, because I saw on the error messages that you're not using a password to log in into MySQL.
__________________
Regards,
Ramiro Varandas Jr.

Reply With Quote
  #3  
Old February 26th, 2003, 07:23 AM
kb31 kb31 is offline
Junior Member
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Nov 2002
Posts: 12 kb31 User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
thankyou for your prompt reply ramz. I have been doing a lot of messing since my original post.

I have modified my script and to conform with my hosts requirements have removed the db discussion and added the tables to the db they allocated to me on my system it all works fine, using the combination of localhost, myusername + mypassword (which are my phpmysqladmin login items)

<?

function db_connect()
{
$result = @mysql_pconnect("localhost", "myusername", "mypassword");
if (!$result)
return false;
if (!@mysql_select_db("newdatabase"))
return false;

return $result;
}

?>

using the hosts phpmysqladmin under mysql db users it shows me as host = localhost (this is why I used it) with the user as the name of my database, whether I use this name + pw or my phpmysqladmin name + pw I get exactly the same errors as my first post. I have also tried using an ip address in place of local host and same results.

any further assistance would be appreciated

kb31

Reply With Quote
Reply

Viewing: Dev Articles Community ForumsDatabasesGeneral SQL Development > switching from localhost to a server


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 5 hosted by Hostway
Stay green...Green IT