Home > Archive > PHP DB > May 2007 > Re: [PHP-DB] [PHP] Cannot connect to an MySQL database using Named
You are viewing an archived Text-only version of the thread.
To view this thread in it's original format and/or if you want to reply to
this thread please [click here]
| Author |
Re: [PHP-DB] [PHP] Cannot connect to an MySQL database using Named
|
|
| John Comerford 2007-05-16, 3:58 am |
| I can connect using MySQL Administrator without any problems, so it
hasn't crash.
bedul wrote:
> try run winmysqladmin.exe
> is there a posibility your mysql server got crash with unknown reason
> ----- Original Message -----
> From: "John Comerford" <johnc@optionsystems.com.au>
> To: <php-db@lists.php.net>
> Sent: Wednesday, May 16, 2007 11:05 AM
> Subject: [PHP-DB] [PHP] Cannot connect to an MySQL database using Named
> Pipes
>
>
>
> <?
> $mysqli = new mysqli("localhost", "my_user", "my_password", "world");
>
> /* check connection */
> if (mysqli_connect_errno()) {
> printf("Connect failed: %s\n", mysqli_connect_error());
> //exit();
> }
>
> printf("Host information: %s\n", $mysqli->host_info);
>
> /* close connection */
> $mysqli->close();
> ?>
>
> can u try above.. I got bad felling bout this??
>
>
>
>
--
1^st Floor, 184 -186 Glenferrie Road, Malvern VIC 3144
PH: *(03) 9500 1466*
FX : *(03) 9500 1469*
Email: johnc@styleman.com.au <mailto:johnc@styleman.com.au>
Web: www.styleman.com.au <http://www.styleman.com.au>
The information in this e-mail is confidential and is intended solely
for the addressee. Any views or opinions presented are solely those of
the author and do not necessarily represent those of Option Systems Pty
Ltd. If you are not the intended recipient, please delete this message
and contact the sender.
| |
| John Comerford 2007-05-16, 3:58 am |
| I got as reply on another forum which resolved this issue. The command
should be:
$mysqli = new mysqli(".", $username,$password,
$database,null,"/tmp/mysql.sock");
NB. host is a dot
>
>
> bedul wrote:
>
>
| |
|
|
|
|
|