Fatal error: Call to undefined function mysql_connect
Jeffrey F. Bloss
jbloss at tampabay.rr.com
Mon Feb 12 17:08:34 UTC 2007
Patrick Newberry wrote:
> I installed apache, php5 and mysql via apt-get
>
> Php commands like echo etc run fine but I get an error when I try to
> connect to a mysql database.
What error exactly?
>
> Googling I found that mysql and php5 are no longer bundled together.
>
> In the PHP manual it mentions:
> Use the --with-mysql[=DIR] configure option
>
> I am assuming that this is located somewhere in the php.ini file?
Actually, no, I believe they're referring to a compile time directive
that tells the php5 configure script where to find the mysql developer
libraries.
The versions you have installed should work together just fine.
>
> Is there anything else I should consider or check out when I go home
> tonight to try to get php5 to work with mysql?
Almost certainly. Start with examining the error message for any clues
beyond "it doesn't work". ;-)
You haven't said whether or not you've set up MySQL administrative or
host access, or even checked to see if it's bound to a proper
port:interface...
What's your /etc/mysql/my.cnf file have in it for a bind-address?
What does the output of 'netstat -tap' tell you about mysql, if
anything?
What do the outputs of 'hostname' and 'hostname -f' say?
Have you issued commands similar to these to set up MySQL?
mysqladmin -u root password <some good password>
mysqladmin -h server1.example.com password <your good password>
You said you're trying to "connect to a database". Have you set up this
database? Does it actually exist at all? Have you properly assigned
ownership and accessed it with the correct password?
It's not really enough to just install the software, it needs a little
bit of configuring. :)
--
_?_ Outside of a dog, a book is a man's best friend.
(o o) Inside of a dog, it's too dark to read.
-oOO-(_)--OOo------------------------------[ Groucho Marx ]---
http://wrench.homelinux.net/~jeff/
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 892 bytes
Desc: not available
URL: <https://lists.ubuntu.com/archives/ubuntu-users/attachments/20070212/4c69a205/attachment.sig>
More information about the ubuntu-users
mailing list