|
|
|||||||||
|
|||||||||
|
|||||||||
| |
|||
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Display Modes |
|
#1
|
|||
|
|||
|
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. |
|
#2
|
|||
|
|||
|
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. |
|
#3
|
|||
|
|||
|
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 |
![]() |
| Viewing: Dev Articles Community Forums > Databases > General SQL Development > switching from localhost to a server |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|