0

i'v built a huge media player with more than 250gigs of music and still growing( it's legal ).

so i need "unlimited" disk space and "unlimited" mysql concurrent connections, and i can get that with dedicated server but it's to much money for me.

so after i stayed on the line with HostGator sales for hour + they gave me this offer..

"you could have an Shared Hosting account with the databases, and just remotely access them from the VPS, but that would be out of scope for us to really help set it up"

so the offer they came back with was that i buy VPS package and Shared Hosting Package.

the VPS package have no "limit" on mysql connections. > the site will be on this account.

the Shared Hosting will have no limit on "Disk Space". > the files and the mysql server will be on this account.

so how can i remotely connect to the mysql db with php ?

Can u guys help me?

3 Answers 3

1

Why don't you put the PHP files and MySql on the VPS and just the music files on the Shared Hosting account? You could access the database from the Shared Hosting if they allow remote access to the MySql port. It doesn't really make sense if they said the VPS had unlimited MySql connections if they didn't mean for you to put the db there.

Sign up to request clarification or add additional context in comments.

2 Comments

so the db suppose to be on the VPS as well as the site?
based on your replies in bold, that would be my assumption, yes.
1
$connect = mysql_connect($server_addr, $username, $password);

Where $server_addr is the remote IP address or domain name of the SQL server, $username is the SQL username and $password is the password for the specified username. Most hosting packages (especially those running on cPanel) require you to specify remote addresses which can connect to the server with your account.

Comments

0

if they offer ssh access, you could create a tunnel over ssh for the mysql port. other options are a vpn (virtual private network) between the computers

also if the are both hosted by the same company, they might be behind the same firewall then there is the possibility you can connect directly to the other box

eg host = ipaddress of server with database on it

3 Comments

it's the same company Hostgator. so i just need to ask them if both computers are behind the same firewall?
just try it and see if it works mysql_connect('ip address of remote machine', 'mysql_user', 'mysql_password');
You'll also need to check which port as most large hosts like that run mysql on many ports in addition to the default, 3306. It's also a question of whether the VPS and shared host are in the same data center, something which could change in the future. Still seems like a better idea to put the db on the VPS where ostensibly you will have more control

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.