Jump to content
xisto Community
Sign in to follow this  
nummell

Mysql

Recommended Posts

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

Share this post


Link to post
Share on other sites

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 Xisto hosting you are able to use Xisto hosting as a remote database but it's at your risk. Please refer to our hosting member area for more information.

Share this post


Link to post
Share on other sites

Thanks for the information.I still need to know how to "call" the database...Usualy is LOCALHOST - USERNAME - PASSWORDHow do you call a database on another host?

Share this post


Link to post
Share on other sites

You could use the connect test code below

<?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.

Share this post


Link to post
Share on other sites

here is the basic and simple php script to connect mysql database

<?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 servermysql_select_db($database,$connection);//to select data basemysql_close();//close the mysql server after use?>

Share this post


Link to post
Share on other sites

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.

Share this post


Link to post
Share on other sites

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.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×
×
  • Create New...

Important Information

Terms of Use | Privacy Policy | Guidelines | We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.