0

I have a domain with a subdomain.

Each of those has a different install of WordPress.

When I created the databases I made the following:

Main Domain = database called: maindomain Sub Domain = database called: subdomain

I applied the SAME database username to both databases....

So all nice and simple....

However, why is the Database Password the same?

/** MySQL database password */
define('DB_PASSWORD', 'passwordhere');

When I reset the password for the database username (which I had forgotten) it made my main domain crash?

So I guess my question is - have I just merged two databases together? Is that even possible?

Hope thats clear!

3 Answers 3

0

I applied the SAME database username to both databases

Why is the Database password the same?

When I reset the password for the database username it made my main domain crash?

It sounds like you created a single MySQL user which is allowed to access both maindomain and subdomain databases. When you change the MySQL user password, you need to update the password in any wp-config.php files where that user is set.

Have I just merged two databases together? Is that even possible?

Based on your description, it sounds like you just need to update the password in the wp-config.php on your maindomain site. It is possible to make your maindomain and subdomain sites point to the same database but you would do that by setting the DB_NAME define and $table_prefix variable exactly the same.

0

The password belongs to the user, not the database. You have multiple databases, but just one user.

You can also have multiple installs share the same database, you just need a unique $table_prefix for each install.

0
0

The credentials you enter in your wp-config files are the credentials you need to require to access WordPress database. Wordpress need 4 things to check the tables that are made for any particular WordPress installation. 1. DB name 2. DB Username 3. DB Password. 4 DB Prefix.

Here in the above table the username and passwords are the database user and database prefix is the unique prefix that is attached to all the tables in WordPress installation. I hope this clears your query.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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