/    Sign up×
Community /Pin to ProfileBookmark

If server is not "localhost"

Hi Forum et All

I have two domains but only one of them have mysql installed. Until now I was always using:
$server = “localhost”;
Is it possible to acces my database from the other domain by changing localhost in the ‘IDoNotKnowWhatHost’?

If this is possible are there any negative experiences by doing that?

Thanks
Jan

to post a comment
PHP

2 Comments(s)

Copy linkTweet thisAlerts:
@olafMar 18.2004 — Hallo,

if it is allowed by ISP you can use the servername where the database is installed (just run php info for the ip or servername).

Example:

for tests on my machine i have to use localhost and on remote the name is mysql.isp.org
Copy linkTweet thisAlerts:
@The_CheatMar 18.2004 — you also have to configure your database to allow connections from outside (i [i]think[/i]...)

However, I am not sure how to do this...
×

Success!

Help @JanKok spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 5.18,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @AriseFacilitySolutions09,
tipped: article
amount: 1000 SATS,

tipper: @Yussuf4331,
tipped: article
amount: 1000 SATS,

tipper: @darkwebsites540,
tipped: article
amount: 10 SATS,
)...