|
|
|
|
![]() ![]() |
Oct 25 2007, 12:40 AM
Post
#1
|
|
|
Member [Level 1] ![]() ![]() ![]() ![]() Group: Members Posts: 70 Joined: 8-October 07 From: Portugal Member No.: 51,339 |
Hi...
One of my hosts hasnīt MySQL but i need to develop a login system so I need to know if itīs possible to use a MySQL database intalled in another host... If itīs possible can you explain me how to do it? Thanks in advance |
|
|
|
Oct 25 2007, 12:46 AM
Post
#2
|
|
|
Desperately seeking "any key" to continue... ![]() Group: Admin Posts: 3,378 Joined: 23-April 05 From: Trap17 storage box Member No.: 6,042 |
Are you referring to using another hosting's SQL? For example, Hosting site B is using hosting site A's SQL?
This is called remote connecting to database and if the hosting company allows remote connection to database, then yes. But majority of hosting companies do not offer because of the security reasons. With Trap17 hosting you are able to use Trap17 hosting as a remote database but it's at your risk. Please refer to our hosting member area for more information. |
|
|
|
Oct 25 2007, 12:59 AM
Post
#3
|
|
|
Member [Level 1] ![]() ![]() ![]() ![]() Group: Members Posts: 70 Joined: 8-October 07 From: Portugal Member No.: 51,339 |
Thanks for the information.
I still need to know how to "call" the database... Usualy is LOCALHOST - USERNAME - PASSWORD How do you call a database on another host? |
|
|
|
Oct 25 2007, 02:50 AM
Post
#4
|
|
|
Advanced Member ![]() ![]() ![]() ![]() ![]() ![]() ![]() Group: Members Posts: 128 Joined: 7-September 07 From: Ningbo, China Member No.: 49,552 |
You could use the connect test code below
CODE <?php $link=mysql_connect('221.133.22.11','root','123456'); if(!$link) echo "connection failure"; else echo "Connection success"; mysql_close(); ?> You should replace "221.133.22.11" with your remote mysql server's IP. "root" will be replaced with your remote mysql server's username. "123456" will be replaced with your remote mysql server's password. It's not a good idea to connect a remote mysql server I think, anyone of server down, your site will down, and transfer your account infomation through internet is really a dangrous action. |
|
|
|
Oct 25 2007, 11:15 PM
Post
#5
|
|
|
Member [Level 1] ![]() ![]() ![]() ![]() Group: Members Posts: 70 Joined: 8-October 07 From: Portugal Member No.: 51,339 |
Thanks for the info...
Maybe Itīs better for me to move my other domain to trap17 |
|
|
|
Apr 6 2008, 07:23 PM
Post
#6
|
|
|
Newbie [Level 1] ![]() Group: Members Posts: 11 Joined: 6-April 08 Member No.: 60,456 |
here is the basic and simple php script to connect mysql database
CODE <?php
$server = "";//database server name $database = "";//database name $username = "";//data base user name $password = "";//database password $connection = mysql_connect($server,$username,$password);//to connect the msql server mysql_select_db($database,$connection);//to select data base mysql_close();//close the mysql server after use ?> |
|
|
|
Apr 6 2008, 09:25 PM
Post
#7
|
|
|
Privileged Member ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Group: [HOSTED] Posts: 937 Joined: 14-April 05 From: West Chester, PA Member No.: 5,636 |
Yeah, just use the scripts above to accomplish what you need. It is very simple since lots of hosts do not even have their own local mysql server. For instance, godaddy gives you the ip for their sql server and you have to use that instead of localhost in your script. It helps keep loads down on very popular servers and such.
|
|
|
|
Apr 6 2008, 10:02 PM
Post
#8
|
|
|
A clever man learns from his own mistakes, a WISE man learns from those of OTHERS ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Group: [HOSTED] Posts: 883 Joined: 12-April 06 From: Essex, UK Member No.: 21,719 |
Well im fairly sure there are flat-file style MYSQL databases... I cant remember the name but try google...
It doesnt require a database server to run, it somehow converts the MYSQL commands (they might vary slightly from normal DB code) into file read-write commands and then uses ordinary (but encoded) files to store the data and then reads and writes to those files so it should work perfectly on your set up. Try google for "flat file database mysql" or something similar. |
|
|
|
![]() ![]() |
Similar Topics
| Topics | Topics | |
|---|---|---|
|
|
|
|