Welcome to the GoFuckYourself.com - Adult Webmaster Forum forums.

You are currently viewing our boards as a guest which gives you limited access to view most discussions and access our other features. By joining our free community you will have access to post topics, communicate privately with other members (PM), respond to polls, upload content and access many other special features. Registration is fast, simple and absolutely free so please, join our community today!

If you have any problems with the registration process or your account login, please contact us.

Post New Thread Reply

Register GFY Rules Calendar
Go Back   GoFuckYourself.com - Adult Webmaster Forum > >
Discuss what's fucking going on, and which programs are best and worst. One-time "program" announcements from "established" webmasters are allowed.

 
Thread Tools
Old 09-14-2017, 06:43 PM   #1
HairyChick
Slowly dying
 
Industry Role:
Join Date: Sep 2012
Location: Padanaram
Posts: 3,091
How To Share A DB Between Sites

I'm planning on a site that has a backend db. I registered a similar domain, too I want to build site A then clone it on site B.

The db needs to be shared on both sites so I can update A and B will update.

Design, post, backend db, everything needs to instantly updated. With amnesia I can't remember how it's done. Ideally, I'd like to update A then click a link in the backend to copy over all changes.

I'd rather not have to ftp over the changes, PHPmyadmin copy the db, etc. Simple and easy with nothing to remember but one click.

Doable? Extensive coding or not too time-consuming?
__________________
*****************************************
Anti-Semites have Small Penis Syndrome. The only known treatment is electroshock therapy combined with cerebellum removal. Fortunately, it’s a tiny procedure.
*****************************************
HairyChick is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 09-14-2017, 09:41 PM   #2
LouiseLloyd
SO FUCKING SCAMMED
 
LouiseLloyd's Avatar
 
Industry Role:
Join Date: Mar 2010
Location: UK
Posts: 1,377
Quote:
Originally Posted by PamWinterReturns View Post
The db needs to be shared on both sites
Have both sites use the same db!?
__________________
LouiseLloyd is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 09-15-2017, 09:21 AM   #3
freecartoonporn
Confirmed User
 
freecartoonporn's Avatar
 
Industry Role:
Join Date: Jan 2012
Location: NC
Posts: 7,683
set up one DB.

set up two sites using same DB.
freecartoonporn is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 09-15-2017, 05:11 PM   #4
HairyChick
Slowly dying
 
Industry Role:
Join Date: Sep 2012
Location: Padanaram
Posts: 3,091
Set up one db? Seems too simple. Build site A, then configure site B with same credentials as site A!?

If so, how will B update ?? Don't I need to manually tell A you update B?
? ?
__________________
*****************************************
Anti-Semites have Small Penis Syndrome. The only known treatment is electroshock therapy combined with cerebellum removal. Fortunately, it’s a tiny procedure.
*****************************************
HairyChick is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 09-15-2017, 05:49 PM   #5
Barry-xlovecam
It's 42
 
Industry Role:
Join Date: Jun 2010
Location: Global
Posts: 18,083
If the domains are on the same server they can use the same database logins as localhost.
Alternatively, each domain could be a separate database user (sharing the same database).

Each database has users with grant privileges given (configured) by the database root.
root@localhost
Code:
mysql -u root -p
Enter password:*******

CREATE USER 'user'@'localhost' IDENTIFIED BY 'password';
GRANT SELECT,INSERT,UPDATE,DELETE,CREATE,DROP
ON `databasesprefix%`.* TO user@localhost IDENTIFIED BY 'password';

FLUSH PRIVILEGES;
A database user (MySQL) can have a difference user name and password than the UNIX (webroot user) -- they probably should.

You can allow database remote connections restricted only to authorized static IPs also.
Barry-xlovecam is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 09-15-2017, 05:51 PM   #6
Barry-xlovecam
It's 42
 
Industry Role:
Join Date: Jun 2010
Location: Global
Posts: 18,083
Quote:
Originally Posted by PamWinterReturns View Post
Set up one db? Seems too simple. Build site A, then configure site B with same credentials as site A!?

If so, how will B update ?? Don't I need to manually tell A you update B?
? ?
Depends on A and B's write privileges to the shared database.
Barry-xlovecam is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 09-15-2017, 06:41 PM   #7
TFCash
Confirmed User
 
Industry Role:
Join Date: Apr 2001
Posts: 1,738
Pam -

you need to specify, are you talking about a custom script that is running the two sites, or are you using wordpress like all your other posts talk about ???

If it's a custom script, then they should be able to share the same database with a few code changes. If your talking about using wordpress for two domains from the same database, it can be done, but it's a lot more headaches than it's worth. Better to just have siteB feed off of siteA with a plugin like https://wordpress.org/plugins/feedwordpress/

__________________
TeenFlood.com Online since 1998.

TFCash KissMeGirl
VirginRiches MondoBucks

tim at tfcash.com or submit a ticket at our HelpDesk
TFCash is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 09-15-2017, 06:58 PM   #8
wankawonk
Confirmed User
 
Industry Role:
Join Date: Aug 2015
Posts: 1,017
easy to do if you have tech skills but if you're fucking around with scripts that other people wrote and you don't understand how they work it's gonna be hard to figure out, and you probably won't find usable technical help on gfy
wankawonk is online now   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 09-15-2017, 07:20 PM   #9
brandonstills
Confirmed User
 
brandonstills's Avatar
 
Join Date: Dec 2007
Location: Chatsworth, CA
Posts: 1,964
When you specify which database to use just specify the connection info to the database.

Typically connection info consists of:

- hostname or IP address (defaults to localhost usually)
- port (usually just leave at default)
- database name (you choose this during setup typically)
- username / password
brandonstills is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 09-16-2017, 12:00 AM   #10
Ferus
Bye - Left to do stuff
 
Industry Role:
Join Date: Feb 2013
Posts: 4,109
- Set the sites up individually
- have a developer build you a script that migrates the data from selected tabels in the database, to the new database
- Have a developer set up a script that replicates selected mediafolders (uploads and media)

Only migrate selected tabels (content related) and media/upload folders.

If you replicate eveything, it will be a pain to maintain in regards to uploads, updates and security
Ferus is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 09-17-2017, 06:23 PM   #11
TACNet
Confirmed User
 
TACNet's Avatar
 
Industry Role:
Join Date: Jan 2009
Posts: 452
Quote:
Originally Posted by PamWinterReturns View Post
Set up one db? Seems too simple. Build site A, then configure site B with same credentials as site A!?

If so, how will B update ?? Don't I need to manually tell A you update B?
? ?
We been doing this for years. One DB server backend that updates multiple sites across multiple servers

Obviously all the sites need to connect to the db server which can be done using localhost (if everything is one one server) or you can grant access by IP address for a multi server environment

Then simply use a script (eg PHP, Perl etc) to produce your pages on-the-fly so any changes are instantly reflected accross all sites

If you have a high traffic page (eg your index page) then you may want to have a cron script update that page say once every hour rather than on-the-fly as it can overload the db server.
__________________


TAC Amateurs - The World's LARGEST Amateur Porn Network
TACNet is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Post New Thread Reply
Go Back   GoFuckYourself.com - Adult Webmaster Forum > >

Bookmarks

Tags
backend, site, update, copy, sites, click, remember, link, ideally, phpmyadmin, doable, extensive, coding, time-consuming, ftp, easy, simple, design, domain, similar, build, clone, registered, share, planning



Advertising inquiries - marketing at gfy dot com

Contact Admin - Advertise - GFY Rules - Top

©2000-, AI Media Network Inc



Powered by vBulletin
Copyright © 2000- Jelsoft Enterprises Limited.