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 afrinspray on 02/23/06 23:22

Ok,
$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?

 

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

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