Click to See Complete Forum and Search --> : Rh 7.3 php4 to MySql connection error


Tony_big
10-29-2002, 08:32 PM
Dear all,
I get a :
Call to undefined function: mysql_pconnect()
I've also tried my_sql_connect() as well and I still get the same error.

I'm able to use mysql from the shell and have created a couple of tables in a test_db however the moment I try to connect to Mysql vai php it all goes belly up.

I've written a scirpt with php info in and can see that Mysql features in the Apache set up.
'--with-ldap=shared''--with-mysql=shared,/usr' '--with-pgsql=shared' '--with-snmp=shared,/usr'
'--with-snmp=shared' '--enable-ucd-snmp-hack' '--with-unixODBC=shared'

There is however no seperate table for the Mysql setting s (there is of postgress) Should this be there or not now that mysql support is included in php4?

I've read other postings and they point to the set up of users and passwords.
I've set the password for root
The code I'm using looks like this:

$connection=mysql_connect("localhost"," "," ");
I've tried all sorts of values for localhost insluding the host id and the virtual host name
I've tried using the user name that I was signed on with and the related password.
I'll be trying next (after restarting the mysql server:
$connection=mysql_connect("localhost","root","<root password>");


any other suggestions


Tony

ineedit
11-06-2002, 01:27 PM
Do you know for sure apache and php were installed with mysql support? When I installed RH 7.3 I installed mysql but did not install support for it in apache and php. If you believe this to be the problem there is an rpm at Redhat's site. You could check your php setup with a phpinfo script.
<?
phpinfo();
?>

Tony_big
11-06-2002, 03:45 PM
I think that certainly Apache is set up with MySQL support checkout the entries from phpinfo above.

I'm currently thinking that the problem is to do with the root mysql user for the localhost.

somewhere else on this bb there is a link to the install instructions these talk about running a script mysql_install_db this will go through and create entries for root for localhost and the host that the dbase is running on in my case MyHost.

After running this script the guide lists 2 commands that are to be run these are to set the root password for the local host and the myhost.

When I try to run the one for localhost it fails. The second one appears to work. It is almost like at somepoint during my tossing around I've managed to set the password to something I nolonger remember. (since I only use one password for the whole system I'm damded if I know what it is)

I suspect that I'll now either reinstall Mysql or will just try using Myhost as the connection.

I must admit it has been a while since I've looked at this. Other stuff has come up.

Sorry I cannot be more exact with the technical bits but all the details are at home.

ineedit
11-06-2002, 04:32 PM
I'm sorry that's what happens when you skip the details...

I remenber installing rh 7.3 and it does not install mysql by default. I know that there are 3 rpm packages on their site mysql, mysql-server and php-mysql. I'm not sure if you need both mysql and server-mysql but I installed both on my system. I've installed mysql on a couple different OS and it has always created the user db for me. I kinda agree that reinstalling it maybe an easy way out.