![]() |
|
#1
|
|||
|
|||
mysql_connect() problemI'm extremely frustrated at the moment. This code works fine on my server, but on a different one it doesn't work. I get no error message from mysql or php, but just a page cannot be found error. If I comment out mysql_connect I will get the "Unable to select database" as I should, but with the mysql_connect call in there, I get the page cannot be found. What is causing this?
- php 4.4.7 - mysql 5.0.1 - php is configured with mysql - the username in question is set in mysql to be allowed to connect remotely PHP Code:
Thank you in advance for any ideas. Last edited by LuciWiz : 14-May-2007 at 14:56.
Reason: Please insert your Php code between [php] & [/php] tags
|
|||
|
#2
|
||||
|
||||
Re: mysql_connect() problemAny OS difference between the servers?
In the connect, try 'localhost' [with quotes], or possibly even '127.0.0.1'. I can't specifically remember the issue, but I seem to recall a similar problem several months back where localhost, even if provided as a string, didn't work. Here's a note about localhost from php.net with mysql_connect: Code:
HTH __________________
Use the force...read the source!! WYCIWYG -- what you code is what you get! |
|
#3
|
|||
|
|||
Re: mysql_connect() problemHi Turbo, thanks for taking the time to reply. I have tried localhost, 'localhost', "localhost", "127.0.0.1", and "127.0.0.1:3306" all to no avail. There is a difference in OS between the two servers, one is Debian linux, and this is AIX 5.3 (which I really have never cared for much, this being yet another issue perhaps).
I log into MySQL from the command line, and the connection ID numbers are being incremented after refresh attempts of this page.. so apparently there is a connection being made, or does this happen even with an unsuccessful connection? It still baffles me however why this line is causing the page load problem. |
|
#4
|
||||
|
||||
Re: mysql_connect() problemI'm not sure what all you might need for AIX, but, I did find something that might be helpful, see here:
http://www-128.ibm.com/developerwork.../au-mysql.html There were more hits, just google this phrase: "mysql on aix" and you'll see others, that might possibly be better. __________________
Use the force...read the source!! WYCIWYG -- what you code is what you get! |
|
#5
|
|||
|
|||
Re: mysql_connect() problemI just realized there is no mysql.so on the system. Shouldn't this have been built when php was built configured for --with-mysql?
|
|
#6
|
||||
|
||||
Re: mysql_connect() problemDepends on how it was configured, I assume:
Quote:
EDIT: I would think that if you have both PHP, and MySQL installed (it appears that you do from the first post, but is this true for BOTH systems?) then there shouldn't be a problem. The --with-mysql merely allows PHP to interface with MySQL, but does NOT install MySQL. Try this: type 'mysql -V' (no quotes) at the command prompt, and see what it replies. __________________
Use the force...read the source!! WYCIWYG -- what you code is what you get! Last edited by TurboPT : 15-May-2007 at 09:35.
|
|
#7
|
|||
|
|||
Re: mysql_connect() problemHi Turbo. Yes, MySQL is installed and running. Like I said, attempts to load the index.php page increments the connection IDs in MySQL. So it SEEMS like it is connecting, but yet still barfs out the broken 'page cannot be displayed' when the mysql_connect() line is not commented out.
Code:
output of mysql -V: mysql Ver 14.12 Distrib 5.0.27, for ibm-aix5.2.0.0 (powerpc) using readline 5.0 This has to be something *really* stupid (Isn't it always?!!) |
|
#8
|
|||
|
|||
Re: mysql_connect() problemOkay well, I got totally frustrated with this today and just blew everything out and started from scratch. After banging my head against a few things I got PHP to compile and link and finally everything is working. I wish I could have figured out what that problem was, but the important thing is it's working now. Thanks Turbo for your input and time!
|
|
#9
|
||||
|
||||
Re: mysql_connect() problemYeah, I had sort of a similar issue with VC++ Express. It has been installed and working well for over a year (going on two, really), and about two months ago, the IDE crashed when trying to compile (or execute from the IDE) any trivial program -- like one of their 'getting started' programs, or even a basic project skeleton generated by their wizard!
I never figured out what caused the IDE to suddenly die. It took a repair install, AND re-installing the associated service pack to get it all working again. Go figure.But anyway, since it works now, that should make you fell like: , I know I did.__________________
Use the force...read the source!! WYCIWYG -- what you code is what you get! |
Recent GIDBlog
Not selected for officer school by crystalattice
| Thread Tools | Search this Thread |
| Rate This Thread | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Graphic problem in Unreal Tournament 2004 | zerox | Computer Software Forum - Games | 10 | 09-Oct-2005 12:31 |
| Runtime Problem involving "printf" in C Program | supamakia | C Programming Language | 2 | 09-Oct-2005 10:09 |
| a significant problem after installing Xp | mohammad | Computer Software Forum - Windows | 10 | 09-Aug-2005 07:03 |
| Another FX 5600 problem (but with details that might shed light on this) | BobDaDuck | Computer Hardware Forum | 2 | 16-Apr-2004 07:53 |
Network Sites: GIDNetwork · GIDWebHosts · GIDSearch · Learning Journal by J de Silva, The