简体   繁体   中英

Two wordpress websites and databases

I have two wordpress websites and each of one a database with a difference prefix ( com_databasename and nl_databasename )

But my question is,, how can I only connect the database users to the two sites ?

First of all make sure you are using the same WordPress version on the two websites.

Go to wp-config.php for 'nl' wordpress and add:

define('CUSTOM_USER_TABLE', 'com_users');
define('CUSTOM_USERMETA_TABLE', 'com_usermeta');

define('COOKIE_DOMAIN', '.yoursite.com');  //replace with the 'com' website url
define('COOKIEPATH', '/');

For more info, see Editing wp-config.php

Go to phpMyadmin. On the phpMyAdmin default page go to users and click on "Privileges". Click on the "Add a new User". enter username and password. Leave all checkboxes in global privileges unchecked and dont create a database. press go button. now you see the user.

click on edit next to user. Under database specific privileges click on add privileges on the database. Chose database and assign the user you want with the priviliges you need

Click go again

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM