Fatal error: Call to undefined function: mysql_connect()

Hi guys
I have moved my site over from my old webhosting box to my nice shiney new Virtualmin site, im running centos 4 and the only thing i have changed is the version of mysql im running is the newer version 5 (which mysql recommend on there site)

Is there something i have missed out, should i downgrade to version 4?



Not that I’m an expert, but did you install the php mysql module?

The current Virtualmin Pro installer doesn’t do this, but Joe is adding it now.

So, maybe just do "yum install php-mysql"?

Hey guys,

You don’t say what you’re trying to do, Richy. Where did you see that error?

Kevin is quite right that you’ll need php-mysql if you’re using php scripts that backup to mysql. Several of the php modules that are needed aren’t installed automatically at the moment, but they can easily be added using yum (or up2date on RHEL). There is another possibility with MySQL5, which I don’t know enough to say is definitely true: the php-mysql libs that come with CentOS were built against MySQL4 as provided by the CentOS RPMs. I can’t say whether this makes a difference, but it seems like it could (it doesn’t in the Perl MySQL libs, but they may be more abstracted than the php libs, I don’t know).

Webmin and Virtualmin themselves should get along with MySQL5 just fine, and if you see any problems file a bug and we’ll fix them.

Anyway, I don’t necessarily recommend upgrading to MySQL5, and I suspect it is asking for unnecessary hassle if you don’t need features found in that version, but we’re gonna support it regardless of the version you choose.

I installed MySQL5 yesterday and on my Centos 4 machine, it is running fine with Virtualmin Pro.

Here is what yum lists for the versions I am running:

Installed Packages
mysql.x86_64 5.0.18-1.c4 installed
mysql-server.x86_64 5.0.18-1.c4 installed
mysqlclient10.x86_64 3.23.58-9.c4 installed
mysqlclient14.x86_64 4.1.14-4.c4 installed
php.x86_64 4.3.9-3.9 installed
php-gd.x86_64 4.3.9-3.9 installed
php-ldap.x86_64 4.3.9-3.9 installed
php-mbstring.x86_64 4.3.9-3.9 installed
php-mysql.x86_64 4.3.9-3.9 installed
php-pear.x86_64 4.3.9-3.9 installed

To install, I uninstalled MySQL4, and added the c4-testing repository to my yum configuration:

cd /etc/yum.repos.d
wget http://dev.centos.org/centos/4/CentOS-Testing.repo

I then used the "yum --enablerepo c4-testing install mysql.x86_64 mysql-server mysqlclient14" to do the install.

Note that when I erased MySQL4 before, it uninstalled virtualmin-base (if I’m remembering correctly) so I reran the install.sh to bring everything back up to date after adding MySQL5.

I also had to run mysql_fix_privilege_tables to fix some stuff in my databases so phpMyAdmin could access them.

But, Virtualmin and my installation of phpMyAdmin seem to be getting along fine so far with MySQL5. I have run into a couple of queries in my PHP scripts that needed syntax changes for MySQL5 (had to do with joins and subqueries), but so far so good.

I am trying to also use Virtualmin with MYSQL5. I am using a fresh RHEL4 system.
I ran install.sh and all looked good.
I then uninstalled MYSQL4 and loaded MYSQL5 which also appeared to work, but I had to uninstall the virtualmin portion that had a dependency on MYSQL4.
When I reran ./install.sh like you did, it looks like it installed MYSQL4 and destroyed MYSQL5…

Alan Sawyer