I’ve got a dedicated server from 1and1 and need to remote connect with the mysql database I have there. The server is running plesk 9 and is using Windows Server 2008. How do I open it to allow a connection from a remote site (as it doesn’t by default)?
Having sorted that lot out:
//MySQL Server 1
$dbhost1 = “184.108.40.206”; - your server IP obviously
$dbuser1 = “dbuser1”;
$dbpassword1 = “dbpass1”;
$db1 = “database1”;
$connection1 = mysql_connect($dbhost1,$dbuser1,$dbpassword1) or die (mysql_error());
//MySQL Server 2
$dbhost1 = “220.127.116.11”; - your server IP obviously
$dbuser1 = “dbuser2”;
$dbpassword1 = “dbpass2”;
$db1 = “database2”;
$connection2 = mysql_connect($dbhost1,$dbuser1,$dbpassword1) or die (mysql_error());
$sql =" SELECT database1.tablename1.fieldname1 AS field1, database2.tablename2.fieldname2 AS field2 FROM database1.tablename1,database2.tablename2";
There shouldn’t be any firewall isues if the server uses default setup settings.
You need to start Remote Desktop Connection to open your server desktop then navigate to your php and MySQL folders.
From your PC: Start > Programs, or All Programs depending on your version of Windows > Accessories > Remote Desktop Connection
Enter your server IP number which will get you on to the server which will then ask for your administrator name (possibly administrator if you haven’t changed it) and your adminsitrator password.
When you get to your MySQL folder, through My Computer, you will be able to click through and see all your database tables, ini files etc.
To get direct access to MySQL and use MySQL commands, on your server click your start button at the bottom left hand side then select RUN from the popup. In the run dialogue box type:
mysql -u root -p and press return.
This will open you MySQL dialogue box which has a black background - similar to what PCDOS was years ago, and you will be prompted with:
Enter your MySQL password which as far as I can remember will be password until you change it.
If you only have the default database i.e. the root database your root username is root.
If you want to create a new database called fred type:
create database fred;
Now you have entered the wonderful world of direct database control so you need to Google and access the manuals. You should be able to figure out what you are doing within 14 days! I hope it takes you a year less than it took me.
I hope this is what you were looking for. good luck.
You will have to ask 1and1 but I suspect that firewalls and mysql permissions will both stop you doing this. Mysql might not even be on a machine that is accessible over the internet, it might just be possible to see it from the webservers.