[FGS] [newbies] fgs-mapserver and mysql

Guillaume Dallaire gdallaire at mapgears.com
Tue May 23 21:58:05 EDT 2006


On Tue, 2006-05-23 at 23:14 +0200, julien.63 at free.fr wrote:
> Hi,
> I'm using the fgs-mapserver package and going through tutorials to see how it
> works.
> As i want to use databases i've installed the mysql package.
> 
> [julien at localhost fgs]$ fgs install php_mysql-module:4.4.2
> http://www.maptools.org/dl/fgs/modules/current
> + Installing php_mysql-module:
>   + Getting and extracting module 'php_mysql-module'... ok
> + Copying all files into FGS environment... ok
> * Module 'php_mysql-module' installed with success.
> 
> So i have :
> /home/julien/fgs/www/lib/php4/php_mysql.so
> /home/julien/fgs/www/lib/php4/mysql.so
> /home/julien/fgs/www/lib/php4/mysql-4.4.2.so
> 
> i guess some mysql stuff were already installed, but i didn't check before :-/
> 
> I've restarted apache.
> 
> But when i make a simple phpinfo(), i have nothing about mysql.
> And when i try to connect :
> <?
> dl('php_mapscript.so');
> dl('mysql.so');
> $connect = mysql_connect("localhost:8080","mysql","password") or die("error
> connexion");
> ?>
> 
> i have an error message :
> Warning: mysql_connect(): Can't connect to local MySQL server through socket
> '/tmp/mysql.sock' (2) in /home/julien/fgs/www/htdocs/test.php on line 12
> 
> I know i must have made something wrong, but i don't know what?
> 
> Is it possible to connect to mysql ($ mysql -u user -p)?

Hi Julien,

I think you should use:

$connect = mysql_connect("localhost","mysql","password") or die('error
connexion');

The default port number for a mysql server is 3306. The port number 8080
is normally used for HTTP protocol.

Guillaume
-- 
________________________________________________
 Guillaume DALLAIRE      gdallaire at mapgears.com
      Mapgears              www.mapgears.com
________________________________________________



More information about the Foss-gis-suite mailing list