Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Call to undefined function: mysql_connect()

Status
Not open for further replies.

tryangle

Technical User
Mar 19, 2001
49
0
0
US
Hi,

I looked through the scripts and didn't see it, so I'm guessing that it's part of a library. I think this has something to do with the $PATH, but I'm not sure, because I'm not familiar with the MySql configuration. safe_mysqld --defaults-file=/etc/my.cnf is running. The my.cnf file is fairly sparse, but it contains this line under [mysqld] socket=/var/lib/mysql/mysql.sock

Also, when I do shell$ mysqladmin version it give me an error,
mysqladmin: connect to server at 'localhost' failed

But if I do it like this, mysqladmin -u username -p version
It gives me the version information after I input my password.

It seems like I have foobar configuration... but I'm not sure.
Whatever the case, I can't seem to do the mysql_connect()

tia,
tryangle

:)
 
Sounds like you are referring to the php function mysql_connect()? If that's the case, you need to install the php-mysql package on your given OS/distribution. On my Mandrake 9.1 box, it's 'urpmi php-mysql'.

----
JBR
 
Hi flugh,

Thanks for your reply. I think you're right. I checked phpinfo() and got it lists this info beside Configure Command

'./configure' '--with-mysql=shared,/usr' '--with-xml' '--enable-track-vars' '--with-apxs=/usr/local/apache/bin/apxs'

It appears to have been configured with MySql support... so, I don't know. If you have any other response on this, I'd appreciate it... I'm gonna post this in the php forum though.

Thanks,
tryangle

:)
 
for fialin mysqladmin without a username, then check if the tables user, db and host in mysql database

open it with mysql -u root -p mysql (no -p if no password)

u will get the clue



[ponder]
----------------
ur feedback is a very welcome desire
 
Hi tshot,

Thanks for your reply... but I don't really understand it. I can get into MySql and there is a mysql database and a user table. But it seems to me that I'm unable to connect using PHP.

Thanks,
tryangle

:)
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top