![]() |
|
#1
|
|||
|
|||
|
After looking into apache i have decided i will continue to use a hosting provider
I have a problem though. I have mysql5 database on my comp and php5 i have created several tables in my database and i would like to keep them. The thing is i am connecting to my database through the hosting company and it wont connect. I have the username password and db name completly setup but i feel its the host name thats giving me problems. what would i use? Usualy when i was doing this through apache it would be localhost but im not sure this could be now. Ive tryed my comps IPv4 address but not working not sure it was the right thing to do anyway. Thanks people for all the help lately. |
|
#2
|
|||
|
|||
|
Hi
If you are trying to connect to your MySQL database on your computer from a page on your hosting companies servers you have a number of problems. It is unlikely that the hosting company will let connections to external servers out throught their firewall for security reasons. You should check this. If they do allow connections though then you will need to set the host name to your public ip address(do you have a static ip address?). Then if you have a router at your location, you will need to forward port 3306 to the computer that has the mysql server on it. Even doing this you will have problems with a slow site because of the path the data has to travel. At the cost of hosting with mysql server installed, I don't think its worth the extra effort and problems of using your computer. Is this the way you want to do it, or the other way (to your host)? I hope this helps and makes sense. Please do not hesitate to contact me if you have any questions. Many Thanks Leo |
|
#3
|
|||
|
|||
|
Thanks leo.
after many discussions with hosting service i finaly found out they infact they do not let me connect to an outside source (firewall and stuff). Thanks very much for the reply. Ben P.S it took me 5 hours of im messaging for them to tell me this and i asked the question 20 times at least aaarghhhhhhh |
|
#4
|
|||
|
|||
|
Hi
Glad you've got to the bottom of it. Sounds typical of some web hosts! Many Thanks Leo |
|
#5
|
|||
|
|||
|
Why not simply transfer the database and PHP scripts to the hosting service. Then you don't have to give the outside world access to your PC, not do you have to keep Apache running on your own PC all the time, nor do you have to keep your own PC switched on all the time, nor do you need a static IP address, nor do yo uhave to worry about your PC crashing and needing a re-boot, nor do you have to handle database back-ups.
It also means you can experiment with ideas and not screw up the online database by trying things on your copy first before transfering them over and going live. Hosting that includes mysql is so cheap (it's often thrown in for free) that whatever you value your own time at, it would cost less than the five hours you spent talking to them and the time you spent trying to solve the problem. |