LinuxQuestions.org
Help answer threads with 0 replies.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 12-19-2005, 02:45 AM   #1
westlm01
LQ Newbie
 
Registered: Dec 2005
Posts: 2

Rep: Reputation: 0
Question Apache and MySQL on different Servers


Hey All,

I have Apache running on a Dedicated Server at home, for the sake of this post we will call this server1. I also have a dedicated server running MySQL and once again we will call this server2. Is is possible for apache on server1 to see and use the database on server2?

Any Solutions are appriciated!

Cheers All

Matthew
 
Old 12-19-2005, 02:57 AM   #2
megaspaz
Senior Member
 
Registered: Nov 2002
Location: Silly Con Valley
Distribution: Red Hat 7.3, Red Hat 9.0
Posts: 2,054

Rep: Reputation: 46
sure it is... because apache has nothing to do with mysql and knows nothing about mysql. You would communicate with mysql through php or cgi scripts like perl or python or java or whatever that has their respective mysql modules installed. These would be on the same machine as your apache server or need to be installed on the same machine as where your apache server is running.
 
Old 12-19-2005, 03:01 AM   #3
denver1980
Member
 
Registered: Dec 2004
Location: Québec
Distribution: Gentoo, Kubuntu Karmic
Posts: 48

Rep: Reputation: 15
If your network is safe, you can just go ahead and go plain text ...
I'm presuming that you have an entry in server1's /etc/hosts for server2 :
Code:
192.168.x.x   server2
When you connect to your DB in a PHP page :
Code:
$Session = mysql_connect(server2, Your_MySQL_User, Your_password) or die (Error_Message);
Be sure to allow connection to your MySQL DB from that user/host combination ...

Edit :
To allow your user from another host, use the GRANT syntax.
This will add the appropriate entry to you mysql.db table

Last edited by denver1980; 12-19-2005 at 03:06 AM.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
multiple mysql servers on 1 server stoffell Debian 1 03-01-2005 07:28 AM
Slackware MySQL, tons of servers and one root? (Also similar with apache) RayQ Linux - Software 0 01-20-2005 08:11 AM
Apache + virtual servers yussef Linux - Software 0 01-08-2005 12:05 PM
How to setup MySQL and PHP servers in different partitions? manofwax Linux - Networking 4 08-18-2004 10:17 AM
Apache and MySQL servers won't run at startup! dday007 Linux - Newbie 2 02-07-2003 04:01 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 09:00 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration