title: how to connect to database when server is in Unix socket?
body: <p>I have a problem with the connection to database (phpmyadmin), it just because my server is in UNIX socket. I don't know how to connect to it (I'm stand on window). The code below is work fine, if my server is in TCP/IP.</p>
  
  <p><strong>My code</strong></p>
  
  <pre><code>&lt;?php
  
  define('DB_SERVER', 'localhost');
  define('DB_USERNAME', 'root');
  define('DB_PASSWORD', 'xxxxxx');
  define('DB_DATABASE', 'sample_db');
  $connection = mysql_connect(DB_SERVER, DB_USERNAME, DB_PASSWORD) or die(mysql_error());
  $database = mysql_select_db(DB_DATABASE, $connection) or die(mysql_error());
  mysql_set_charset("utf8", $connection);
  
  ?&gt;
  </code></pre>
  
  <p>Can anyone tell me how to connect to database, if the server is in UNIX socket?</p>
  
  <p>Thank in advance</p>