Connect MySql that is hosted on another server

-1

I have Centos installed with php + apache running

This centos is local but I want to use this local server to connect to a mysql database that is on a server on the internet.

I have firebird installed on this centos, and I can connect to it normally.

When I try to connect to MySql from this error.

Fatal error: Call to undefined function mysql_connect() in 

Obs. the connection file works correctly on the server that is on the internet.

    
asked by anonymous 16.12.2014 / 17:24

1 answer

1

What happens is that your PHP is not supported by MySQL - based on --without-mysql.

If it is a Linux environment, you will need to install the php5-mysql package.

Also remember two more details:

  • Your MySQL user needs to have privileges for external access
  • Consider using the PDO class for database manipulation
  • 21.12.2014 / 18:52