title: Access php database server cpanel
body: <p>I can't connect to my <code>MySQL</code> database which is held by a hosting provider.</p>
  
  <p>I've set up accounts correctly in <code>cPanel</code> so I can connect to database when I run my <code>php</code> code from <code>phpadmin</code> server.</p>
  
  <p>But now I want to access it from a database tool on Mac rather than <code>phpmyadmin</code>. I've added my <code>IP</code> (both <code>IP</code> and <code>DNS</code> name..) to "Remote Database Access Hosts" in <code>cPanel</code>.
  I've tried to connect both from <code>PHP</code> and directly. I always get:</p>
  
  <pre><code>MySQL Said: Can't connect to MySQL server on 'xxx.xxx.xxx.xxx' (4)
  
  Use the following configuration settings for connecting to your database:
  </code></pre>
  
  <p>I have tried this: </p>
  
  <ol>
  <li>Host name = (use the server IP address) </li>
  <li>Database name =(cpanelUsername_databaseName)</li>
  <li>Database username = (cpanelUsername_databaseUsername) </li>
  <li>Database password = (the password you entered for that database user) </li>
  <li>MySQL Connection Port = 3306</li>
  </ol>