Call to undefined function: mysql_connect()

  • Willy
  • Graduate
  • Graduate
  • No Avatar
  • Joined: Jul 03, 2003
  • Posts: 199
  • Status: Offline

Post July 8th, 2003, 8:52 pm

I am running a redhat 8 server, with php 4.2 (came with install) and i rpm'd mysql client/server 4.0.13. My problem is that apache / php is not recognizgin my mysql connects. WHen i look in php info i see that it is built --with-mysql

I've read around a lot, and it seems there should be a php-mysql rpm, i in fact found the one for the versions ihave but it needs a libmysqlclient.so.10 dependancy

as i try to solve this dependancy i just get cross dependancys :(

~justin
  • Anonymous
  • Bot
  • No Avatar
  • Joined: 25 Feb 2008
  • Posts: ?
  • Loc: Ozzuland
  • Status: Online

Post July 8th, 2003, 8:52 pm

  • Bigwebmaster
  • Site Admin
  • Site Admin
  • User avatar
  • Joined: Dec 20, 2002
  • Posts: 8926
  • Loc: Seattle, WA & Phoenix, AZ
  • Status: Offline

Post July 8th, 2003, 11:26 pm

So are you saying when you try to install the dependency, it then says that it needs the other first?

Try installing both at the same time if this is the case, all on the same line. That way they won't complain that they need the other first, as they will both have each other. So for example you could go something like

rpm -ivh libmysqlclient.rpm php-mysql.rpm

(Note, I am guessing on the rpm names)

Hopefully I understood you right. Let me know.
Ozzu Hosting - Want your website on a fast server like Ozzu?
  • Willy
  • Graduate
  • Graduate
  • No Avatar
  • Joined: Jul 03, 2003
  • Posts: 199
  • Status: Offline

Post July 9th, 2003, 7:17 am

Nice, the rpm's installed succesfully with the 2 in one line technique. I'm still getting the connect error however!!

i got htis warning on the RPM : warning: /etc/php.d/mysql.ini created as /etc/php.d/mysql.ini.rpmnew

after the connect was still not working i renamed these files so that .ini.rpmnew was just .ini ... The .ini file contains only one line :
; Enable mysql extension module
extension=mysql.so

when i run locate on my box i can only find "/var/lib/mysql/mysql.sock"

~j
  • Bigwebmaster
  • Site Admin
  • Site Admin
  • User avatar
  • Joined: Dec 20, 2002
  • Posts: 8926
  • Loc: Seattle, WA & Phoenix, AZ
  • Status: Offline

Post July 9th, 2003, 1:10 pm

Do you have MySQL actually running? You can check a few ways:

/etc/rc.d/init.d/mysqld status

or

ps auxw | grep mysql

and see if you have any processes running. In order for your scripts to work the MySQL daemon has to be going. Also are you sure you are using the right username and password in your scripts to connect to the MySQL database you had created for that script?
Ozzu Hosting - Want your website on a fast server like Ozzu?
  • Bigwebmaster
  • Site Admin
  • Site Admin
  • User avatar
  • Joined: Dec 20, 2002
  • Posts: 8926
  • Loc: Seattle, WA & Phoenix, AZ
  • Status: Offline

Post July 9th, 2003, 1:25 pm

What exactly does your phpinfo tell you. Paste it here.
Ozzu Hosting - Want your website on a fast server like Ozzu?
  • Willy
  • Graduate
  • Graduate
  • No Avatar
  • Joined: Jul 03, 2003
  • Posts: 199
  • Status: Offline

Post July 9th, 2003, 4:54 pm

Ok, i cant find mysql in that rcd./init
This is where i run all my deamos from which is iwerd. I know i rpm'd mysql, and previously went in and made a table. I guess i just assumed it to be up and running correctly.

i was going to rule out the username / password thing because php dosent even recognize mysql, but i guess i dont HAVE to with this stupid issue.

i deff ran:
rpm -Uvh MySQL-client-4.0.13-0.i386.rpm and
rpm -Uvh MySQL-server-4.0.13-0.i386.rpm
does redhat packet manager auto put these things in rc.d???

i'm kinda hung up on idiocy now, files i have located :
/etc/rc.d/rc3.d/S20mysql
*thought that would start it at boot??
/usr/sbin/mysqld
*appears to be doing nothing...

mysql itself appears to be in /usr/bin/mysql
when i run it ::
[root@localhost bin]# ./mysql
ERROR 2002: Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock' (2)

well, things felt like they were getting lcose, now i feel a turn ofr the worse has happend... Any suggestions?

~justin

ohh and php.info can be seen at http://www.brahh.com
  • Bigwebmaster
  • Site Admin
  • Site Admin
  • User avatar
  • Joined: Dec 20, 2002
  • Posts: 8926
  • Loc: Seattle, WA & Phoenix, AZ
  • Status: Offline

Post July 9th, 2003, 5:23 pm

pintoumd wrote:
ohh and php.info can be seen at http://www.brahh.com


That url says server not found for me.

Also did you check to see if any mysqld processes are even running by typing:

ps auxw | grep mysql

from a command console?
Ozzu Hosting - Want your website on a fast server like Ozzu?
  • Willy
  • Graduate
  • Graduate
  • No Avatar
  • Joined: Jul 03, 2003
  • Posts: 199
  • Status: Offline

Post July 9th, 2003, 6:06 pm

I guess the internet is down over at the apartment...


i did run the process lookup command, and couldn't find mysql. It was giving me that funny connect msg a la the end of 2 posts ago when i tried to get on.

~justin
  • Bigwebmaster
  • Site Admin
  • Site Admin
  • User avatar
  • Joined: Dec 20, 2002
  • Posts: 8926
  • Loc: Seattle, WA & Phoenix, AZ
  • Status: Offline

Post July 9th, 2003, 6:41 pm

Hmm interesting, when you installed Redhat 8 are you sure you checked all the packages for MySQL ?

Also it just seems weird to me that you have this startup script:

/etc/rc.d/rc3.d/S20mysql

but you do not have anything located here:

/etc/rc.d/init.d/mysql

Try this. Goto the /etc/rc.d/rc3.d/ directory and type:

ls -la

and see where /etc/rc.d/rc3.d/S20mysql is linking to. If it is flashing it means its linking to a link that no longer exists. So post here where its linking and let us know if its flashing or not. Usually it would be linking to /etc/rc.d/init.d/mysqld

On my server you can see that it links there. When I type the ls -la command I can see that it shows:

S78mysqld -> ../init.d/mysqld

which means its linking to the actually mysqld script in the init.d directory.
Ozzu Hosting - Want your website on a fast server like Ozzu?
  • Willy
  • Graduate
  • Graduate
  • No Avatar
  • Joined: Jul 03, 2003
  • Posts: 199
  • Status: Offline

Post July 9th, 2003, 6:55 pm

http://www.brahh.com should be up now
  • b_heyer
  • Web Master
  • Web Master
  • User avatar
  • Joined: Jun 15, 2003
  • Posts: 4583
  • Loc: Maryland
  • Status: Offline

Post July 9th, 2003, 7:48 pm

I had a problem like this in Mandrake 9 where it doesn't recognize "mysql_free_results()" haven't fixed it yet, kind of a bummer :(
Pixel Acres V2
  • Willy
  • Graduate
  • Graduate
  • No Avatar
  • Joined: Jul 03, 2003
  • Posts: 199
  • Status: Offline

Post July 9th, 2003, 10:13 pm

[root@localhost rc3.d]# ls /etc/rc.d/rc3.d/
K05saslauthd K50tux S09isdn S15httpd S26apmd S56rawdevices S95anacron
K15postgresql K70aep1000 S10network S17keytable S28autofs S56xinetd S95atd
K20nfs K70bcm5820 S12syslog S20random S45named S80sendmail S97rhnsd
K24irda S05kudzu S13portmap S24pcmcia S50vsftpd S85gpm S99local
K25squid S08iptables S14nfslock S25netfs S55sshd S90crond
[root@localhost rc3.d]# locate mysql | grep rc.d
/etc/rc.d/init.d/mysql
/etc/rc.d/rc0.d/K20mysql
/etc/rc.d/rc1.d/K20mysql
/etc/rc.d/rc2.d/K20mysql
/etc/rc.d/rc3.d/S20mysql
/etc/rc.d/rc4.d/K20mysql
/etc/rc.d/rc5.d/K20mysql
/etc/rc.d/rc6.d/K20mysql
  • Bigwebmaster
  • Site Admin
  • Site Admin
  • User avatar
  • Joined: Dec 20, 2002
  • Posts: 8926
  • Loc: Seattle, WA & Phoenix, AZ
  • Status: Offline

Post July 9th, 2003, 11:15 pm

Oh, you have a mysql startup script, its just called mysql and not mysqld. Try typing this in your command console:

/etc/rc.d/init.d/mysql status

and see what it says. If it says its not running type:

/etc/rc.d/init.d/mysql start

then type this again:

/etc/rc.d/init.d/mysql status

and make sure its going. Let me know your results.
Ozzu Hosting - Want your website on a fast server like Ozzu?
  • Willy
  • Graduate
  • Graduate
  • No Avatar
  • Joined: Jul 03, 2003
  • Posts: 199
  • Status: Offline

Post July 10th, 2003, 7:09 am

# ls /etc/rc.d/init.d/
aep1000 bcm5820 httpd keytable network portmap saslauthd syslog
anacron crond iptables killall nfs postgresql sendmail tux
apmd functions irda kudzu nfslock random single vsftpd
atd gpm isdn named nscd rawdevices squid xinetd
autofs halt kdcrotate netfs pcmcia rhnsd sshd

no mysql file in here...

on a locate i find the following:
/usr/bin/mysql

then

# /usr/bin/mysql status
ERROR 2002: Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock' (2)
that poops out
same thing when i try to run it
i jsut tried to locate mysql.sock ... couldnt find it!?!

should i try re-rpming the mysql ? ? (i'm not exactly sure what command i use to overwrite a rpm install) ... Also, Mysql did not come with my redhat 8 installation. Only apache and php did {to clear up any confusion, i think you mentioned it in the previous msg}

thx
~justin
  • Bigwebmaster
  • Site Admin
  • Site Admin
  • User avatar
  • Joined: Dec 20, 2002
  • Posts: 8926
  • Loc: Seattle, WA & Phoenix, AZ
  • Status: Offline

Post July 10th, 2003, 2:07 pm

Did you install Redhat? or is did someone else? If you installed Redhat it comes with it, you might just have to make sure you check the packages to be installed. If you are able to reinstall the entire server I would do that and goto custom and make sure you select all packages you think you want.

If someone else installed the server or you do not have access to reinstall the server (or do not want to) then maybe reinstalling MySQL (if it was ever really installed) would be the best way. Type

man rpm

That should give you instructions on how to uninstall an RPM if you want to do that. If you cannot figure it out let us know.
Ozzu Hosting - Want your website on a fast server like Ozzu?
  • Anonymous
  • Bot
  • No Avatar
  • Joined: 25 Feb 2008
  • Posts: ?
  • Loc: Ozzuland
  • Status: Online

Post July 10th, 2003, 2:07 pm

Post Information

  • Total Posts in this topic: 18 posts
  • Users browsing this forum: No registered users and 38 guests
  • You cannot post new topics in this forum
  • You cannot reply to topics in this forum
  • You cannot edit your posts in this forum
  • You cannot delete your posts in this forum
  • You cannot post attachments in this forum
 
 

© 2011 Unmelted, LLC. Ozzu® is a registered trademark of Unmelted, LLC.