murakamifund300
murakamifund300

Reputation: 35

Do I need to create separate database when installing more than one copy of WordPress?

I have a shared hosting plan where it allows multiple domains. I'm new to making websites so not knowledgeable. I have successfully installed WordPress to site A but wondering if I need to create a database (I don't know what the function of this thing).

They gave me FTP root which is called mike123.main.net

Under that, I connected mysite1.com and mysite2.com

I'm trying to installed WordPress to mysite2.com (I already installed WordPress in mysite1.com).

The "database" I'm talking about is the thing that let's me create up to 30 and its "host name" starts with mysql128.phy. I'm not quite sure what this is and does.

Upvotes: 1

Views: 94

Answers (2)

Kirk Beard
Kirk Beard

Reputation: 9843

WordPress will create the required database tables in using a a prefix. Taken from wp-config.php:

/**
 * WordPress Database Table prefix.
 *
 * You can have multiple installations in one database if you give each
 * a unique prefix. Only numbers, letters, and underscores please!
 */
$table_prefix  = 'wp_';

By default, WordPress uses wp_ as the prefix, but this can be modified when you install WordPress.

For your specific case, on your second, third site, etc, you can change the prefix for each installation. Provided you have a unique prefix per site, it shouldn't cause any problems.

There are other things to consider:

  • Since all websites are using the same database credentials, all sites will have full access to the database tables of other websites. This could be a potential security risk, depending on the nature of the sites being hosted.
  • Some backup plugins/scripts may backup all tables in the database. This might lead to backup of Site1 also containing the tables used by Site2 and so on.

Upvotes: 2

Amit Joshi
Amit Joshi

Reputation: 1354

I would recommend you create separate database for separate domains as it will make later maintenance and management easy (even though it's possible to use the same database).

Upvotes: 2

Related Questions