# \[PHP\] Connecting to MySQL DB on remote controlled PC

**URL:** <https://forum.kirupa.com/t/php-connecting-to-mysql-db-on-remote-controlled-pc/253820>\
**Category:** programming\
**Created:** [March 5, 2008, 1:08pm UTC](https://forum.kirupa.com/t/php-connecting-to-mysql-db-on-remote-controlled-pc/253820 "2008-03-05T13:08:42Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![DangerousDan](https://avatars.discourse-cdn.com/v4/letter/d/ad7895/32.png) [@DangerousDan](https://forum.kirupa.com/u/DangerousDan)\
**Post date:** [March 5, 2008, 1:08pm UTC](https://forum.kirupa.com/t/php-connecting-to-mysql-db-on-remote-controlled-pc/253820/1 "2008-03-05T13:08:42Z")

</div>

```php

//name of PC is rottserver
mysql_connect("localhost", "rottserver", "password_here") or die(mysql_error());

```

How would I go about connecting to my database online?

If I have to host the database, anyone have some free MySQL hosting options?  
(P.S. if this helps, I’m willing to dedicate this computer to hosting the database if at all possible)
