You are here: Re: Using PHP to Connect to a Remote MySQL Server « PHP SQL « IT news, forums, messages
Re: Using PHP to Connect to a Remote MySQL Server

Posted by Steve on 02/24/06 00:00

> $conn = mysql_connect($mysql_host, $username, $password, true);

> Where
> $mysql_host = another server (db.example.com)
> $username = the username in the mysql database
> $password = the password of the the user above

> This all works if I use the command line mysql command with the -h
> command for specifying a host. It's just through php that I get the
> /tmp/mysql.sock does not exist error. I'm just confused why php would
> require the socket if it's not connecting to mysql locally. Does PHP
> require that the localhost have a mysql server installed even if I'm
> connecting to a remote server?

I don't suppose you could post the actual text of the error message,
too.

In the meantime you could try using the IP address instead of the host
name, in case DNS lookups are failing for some reason.

---
Steve

 

Navigation:

[Reply to this message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация