Question:
How to use MySQL on a web server (2)?
Karl R
2009-01-21 10:09:17 UTC
I feel a little more confused now and that my question before wasn't very specific or correct to what my problem is. At the moment I have this "would be" web application sitting on my local host. Yes this has apache installed and that I could run it on this. But I don't want to. I'd rather run it on my web server which I access usually via ftp client. When I upload the site to the internet and attempt to register. I will lose connection with MySQL because the database still remains on my localhost. In my mysqli_connect.php document I have the DB_HOST as 'localhost' do I need to change this or any other settings for it to work like a regular web app on its own. Like I've said I may not have enough knowledge of PHP and I'm totally missing the point.
The app at the moment is:
http://www.karl.girlsdontlikeme.com/ch03/index.php

Thanks much. Karl..
Three answers:
Jonathan B
2009-01-21 10:22:47 UTC
In a nutshell:



1. Turn on MySQL with your web host. If you don't already have it, it might cost you money.

2. Export your data from your locally running MySQL.

3. Import data to the remote server's MySQL.



If you don't already have it, phpMyAdmin will make life much easier for you, both locally and remotely.



Generally speaking, leaving the DB_HOST as 'localhost' should not cause any problems. Your web hosting provider should have instructions regarding this.
mti2935
2009-01-21 10:21:37 UTC
It sounds like what this all boils down to is that you want to run your PHP scripts on server A, and have them connect to a mysql database running on server B.



If that's the case, then you need to specify the address of server B in your mysql_connect statement (instead of localhost).



Then, it *might* work, but most likely you will still need to create privelges (using the mysql GRANT statement) in the mysql database to allow access from server A. Also, if server B is behind a firewall, you may need to open the port for mysql to allow incoming connections from server A.



Hope this helps.
2014-09-13 07:40:30 UTC
Hey ciao,

Ho scaricato phpMyAdmin gratis da questo link: http://j.mp/X7KfJS



Il download e' molto rapido e il link e' perfettamente funzionante!

Bye Bye


This content was originally posted on Y! Answers, a Q&A website that shut down in 2021.
Loading...