Sky UK Net Logo HostSys UK Logo
Platform Update: Sky UK Net is transitioning into our new primary brand, HostSys UK, to deliver upgraded NVMe hosting infrastructure. Existing customer services remain fully operational throughout this transition.

How do I connect to my MySQL database? Print

  • 1406

We do not block remote connection so you can connect to your MySQL database from your office PC or fro myour development machiene. 

A simple 
php script to open a connection to a database 

<?php 
$dbhost = 'localhost'; 
$dbuser = 'db username'; 
$dbpass = 'db password'; 

$conn = mysql_connect($dbhost, $dbuser, $dbpass) or die ('Error connecting to mysql'); 

$dbname = 'db name'; 
mysql_select_db($dbname); 
?> 

Save this as <something>.php and then whenever you want to access the database, just add 

include '<something>.php

to the top of a php script and the database can be queried using standard sql commands. 

Was this answer helpful?

« Back