MySQL in different Location/How?

Detlev

macrumors 6502a
Original poster
Sep 16, 2003
507
0
I have a site already but am changing the way the shopping cart is set up. The trouble is I need MySQL and my host does not support it. I have been told I can run MySQL on a local machine and somehow point the new php cart to it. My question is how do I do this? I need very basic step by step information on how to do this. Presently, I have downloaded MySQL and installed it.
 

pulsewidth947

macrumors 65816
Jan 25, 2005
1,106
2
MySQL really should be run from a Server, or something that is on 24/7 with internet access.

The way MySQL works with PHP is you set a few variables (hostname, username, password, database) for PHP to use to connect. The hostname is whats most important here. If you did run MySQL from your computer, then you'd need a static IP address for that computer. Then you could simply set the hostname to that IP e.g. 192.12.123.52 etc.

I'd suggest looking for a host that already has MySQL/PHP installed, as it could potentially be much less hassle.
 

rendezvouscp

macrumors 68000
Aug 20, 2003
1,526
0
Long Beach, California
Usually in your PHP file there's one file that connects to the database. I'll use this as an example, since I'm not familiar with shopping cart software.

In WordPress, there's a configuration file that connects to the database and has these variables:

Code:
define('DB_NAME', 'name');     // The name of the database
define('DB_USER', 'user');     // Your MySQL username
define('DB_PASSWORD', 'password'); // ...and password
define('DB_HOST', 'localhost');     // 99% chance you won't need to change this value
The 'localhost' value can be changed to the ip address you want, like 192.12.123.52. I hope this helps you a bit.
-Chase
 

superbovine

macrumors 68030
Nov 7, 2003
2,872
0
Detlev said:
I have a site already but am changing the way the shopping cart is set up. The trouble is I need MySQL and my host does not support it. I have been told I can run MySQL on a local machine and somehow point the new php cart to it. My question is how do I do this? I need very basic step by step information on how to do this. Presently, I have downloaded MySQL and installed it.

you should get web hosting the offers both. hosting it on a local machine is sorta of pointless unless you have a static ip address and you know how to configure a router with point forwarding etc. also, web hosting places will be in a data center with fiber connection to the internet from multiple services which means your bottleneck of bandwidth won't be your home broadband connection. they are also kind enough to backup your data, and probably have fire protection in the data center.