Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p><a href="http://php.net/mysql_connect" rel="nofollow noreferrer"><code>mysql_connect()</code></a></p> <pre><code>$resource = mysql_connect('other-server-address.com', 'username', 'password'); </code></pre> <p>The first parameter is the mysql server address.</p> <blockquote> <p><strong>Server Param</strong></p> <p>The MySQL server. It can also include a port number. e.g. "hostname:port" or a path to a local socket e.g. ":/path/to/socket" for the localhost.</p> <p>If the PHP directive mysql.default_host is undefined (default), then the default value is 'localhost:3306'. In SQL safe mode, this parameter is ignored and value 'localhost:3306' is always used.</p> </blockquote> <p>Unless I'm misunderstanding... this setup is pretty common. Any trouble you're having might be related to the following:</p> <ul> <li>Firewall settings</li> <li><a href="https://stackoverflow.com/questions/282084/php-access-to-remote-database">Grant access to the mysql user to connect from the other host</a></li> <li><a href="https://stackoverflow.com/questions/53491/how-do-i-enable-external-access-to-mysql-server">my.ini settings not allowing outside connections</a></li> </ul> <p>Some other related SO questions:</p> <ul> <li><a href="https://stackoverflow.com/questions/804772/connecting-to-mysql-from-other-machines">Connecting to MySQL from other machines</a></li> <li><a href="https://stackoverflow.com/questions/53491/how-do-i-enable-external-access-to-mysql-server">How do I enable external access to MySQL Server?</a></li> <li><a href="https://stackoverflow.com/questions/282084/php-access-to-remote-database">php access to remote database</a></li> <li><a href="https://stackoverflow.com/questions/938047/how-to-make-mysql-accept-connections-externally">How to make mysql accept connections externally</a></li> <li><a href="https://stackoverflow.com/questions/670949/remote-mysql-connection">Remote mysql connection</a></li> </ul>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload