Wordpress共享用户数据库进行登录 [英] Wordpress share users database for Login

查看:645
本文介绍了Wordpress共享用户数据库进行登录的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想做的是在同一个数据库上的2个或更多Wordpress安装之间共享用户凭据。我读了很多教程,论坛上这一个,但没有给我一个明确的答案这一个。所以根据Wordpress Codex([1]),我所要做的是将下面的代码添加到wp-config.php(子安装),以切换用户和usermeta的表:

What i'm trying to do is to share the users credentials between 2 or more Wordpress installations on the same database. I read many tutorials, and forums on this one but none gave me a clear answer on this one. So according to Wordpress Codex ([1]), all I have to do is add the code below to wp-config.php (child installation) in order to switch tables for users and usermeta:

define( 'CUSTOM_USER_TABLE', 'main_users' );
define( 'CUSTOM_USER_META_TABLE', 'main_usermeta' );

这允许我使用根网站的用户名和密码登录, / p>

This allows me to login with the root sites' username and password but I'm getting the message


您没有足够的权限存取这个专页。

You do not have sufficient permissions to access this page.

然后我完全失去了。我检查了数据库中的_capabilities,如[1]所述,但仍然收到该消息。

Then I'm completely lost. I checked the _capabilities inside the database as stated at [1] but still getting that message.

任何帮助将真的很感激,因为我工作在这一个为3天。谢谢!

Any help would be really appreciated since I'm working on this one for 3 days. Thanks!

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

推荐答案

这不完全是正确的方式去。如果你成功了,我想你会打开自己一些严重的安全漏洞。

This is not quite the right way to go about it. If you succeed with this, I think you'd be opening yourself up to some serious security vulnerabilities.

相反,你应该考虑创建一个WordPress多站点安装。 Multisite的详细信息位于: http://codex.wordpress.org/Create_A_Network

Instead, you should look into creating a WordPress Multisite install. The details of Multisite are here: http://codex.wordpress.org/Create_A_Network

您还可以在这里了解更多关于Multisite的信息: http://mashable.com/2012/07/26/beginner-guide-wordpress-multisite/

You can also learn more about Multisite here: http://mashable.com/2012/07/26/beginner-guide-wordpress-multisite/

尝试获得两个单独的安装共享信息不是正常的方式来攻击这个问题...大多数时候有这个要求,我看过人们使用Multisite。

Trying to get two separate installs to share information isn't the normal way to attack this problem... most of the times with this requirement, I've seen people use Multisite.

这篇关于Wordpress共享用户数据库进行登录的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆