Take the 2-minute tour ×
WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. It's 100% free, no registration required.

I have two wordpress installations with same host with different folders. Each installation uses its own database. I mean, database are separated. I am not using one database for two wordpress installations.

My Problem: I have two different member databases. Because my wordpress installation databases are not shared. So i want to use wpA database as my main database for sharing users only. And my second wpB installation must use its own table, but only must use members from wpA database.

How can i do that ?

Summary

  • I have wordpress installations in different directories.

  • I have different databases for both installations.

  • I want to use wp installation b use wp installation a members as a default members.

  • If somebody wants to register on wordpress b, he should registered on database A automatically.

  • If somebody logged in wordpress site A using database A, they can be verified on wordpress site b without extra registration.

I don’t know English very well so if I made mistakes, I am sorry.

share|improve this question
add comment

2 Answers 2

I had to do something similar. What you need to do first is in each of your config files define the table prefix ... make sure that they are different.

Example: WordPress installation 1: wp123_ WordPress installation 2: wp124_

Your first installation would be your main installation the one with the user table you want to use. Then in the second installation's config file you need to add this in it:

//Adding so that this blog uses the same user tables as the main

define('CUSTOM_USER_TABLE', 'wp123_users');
define('CUSTOM_USER_META_TABLE', 'wp123_usermeta');

Also what you need to do is put the sites in a shared database. So that the database name is the same, database user is the same, and database password is the same. Basically connection is the same. If this make sense.

What i have above is what will allow for two different WordPress installations to share the same user base.

share|improve this answer
    
Thanks, but my problem is different. I want to use different database.This is the main point; different databases. So i want to use different wordpress installation with different database, but also i want to use shared members. For example i have 2 installation wpA and wpB. And i am using dbA for wpA and dbB for wpB. What i need is, wpB can use wpA members (ond dbA) for authantication and registration.I mean, if somebody want to register to site on wpB, this registration should save on dbA. If somebody logged in on wpA , they can logged in wpB same time.. Help me please. –  Rasih Oct 26 '12 at 16:47
1  
You can't then. You have to combine the installations with the different table prefixes like mentioned above. –  Nicole Oct 26 '12 at 17:06
add comment

Since they are on the same server, I think you can probably do this. However, my PHP is not that great, so this is just a starting point.

http://codex.wordpress.org/Editing_wp-config.php#Custom_User_and_Usermeta_Tables

share|improve this answer
    
Thanks, for your idea, but it is not solution for me. If i know, how can i include ConfigA database information to config B, and if i know how can i define some user tables and set to A tables for B using, i can do. But i need exact solution, because i have to do that, i need it. If anyone experinced about this subject, please offer me a solution. –  Rasih Oct 25 '12 at 23:32
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.