title: Message: mysqli::real_connect(): php_network_getaddresses: getaddrinfo failed: No such host is known
body: <p>I am new to PHP MVC CI and </p>
  
  <p><strong>I am getting below error.</strong></p>
  
  <blockquote>
    <p>Message: mysqli::real_connect(): php_network_getaddresses: getaddrinfo
    failed: No such host is known.</p>
  </blockquote>
  
  <p><strong>Below is my info being passed.</strong></p>
  
  <blockquote>
    <p>hostname:<a href="http://localhost:1234/Sample/" rel="nofollow">http://localhost:1234/Sample/</a> </p>
    
    <p>username:root </p>
    
    <p>password:  //here Password is blank</p>
    
    <p>database:codeignitordb </p>
    
    <p>port:1234</p>
  </blockquote>
  
  <p><strong>Function</strong></p>
  
  <pre><code>$mysqli-&gt;real_connect($hostname, 
                        $this-&gt;username, 
                        $this-&gt;password, 
                        $this-&gt;database, 
                        $port, 
                        $socket, 
                        $client_flags);
  </code></pre>
  
  <p>here <code>$socket</code> and <code>$client_flags</code> are <code>Null</code></p>
  
  <h1>Question: Am I missing something ?</h1>