Vivek Sharma
Vivek Sharma

Reputation: 3814

Can two different sites running on same host, share same database for storage and retrieval?

I am building a personal site, for a blog I wish to use WordPress and for a wiki i will use wikia. Is it possible that i use the same database for storing articles from both frontends (WordPress and wiki). If yes can i some how populate articles from my wiki to the blog, under a specific category.

EDIT-- By two different sites I mean two different frontends, hosted at different subdomains.

Upvotes: 2

Views: 6355

Answers (6)

Kev
Kev

Reputation: 119856

At installation time, both WordPress and Wikka allow you to prefix their tables with different names to prevent naming collisions. So yes it is possible to allow both applications to share the same database.

We have plenty of customers on our shared hosting environment who do this without any issues.

In answer to your second question, you may be in for a bit of custom code to do that.

Upvotes: 3

Hooloovoo
Hooloovoo

Reputation: 2181

They can quite happily use the same database. Depending on the RDBMS you are using, you may want to create an additional Database or user instance for each site.

With SQL Server you can create an additional database, or you can add a schema for each site. for Oracle you can create a user specific to each site.

To return data from one place to another, simply build a view which is accessible to each schema. You will need to set privileges on the source database to do this, but that's pretty straightforward.

Upvotes: 1

John MacIntyre
John MacIntyre

Reputation: 13031

The short answer is YES.

However, you will need to watch out for database object naming conflicts.

Also, when you say 'two different sites' do you mean 2 different sites? Or just different 'frontends' within the same site? If it just different front apps running in the same website, then you will also have to make sure you won't have any configuration conflicts.

Upvotes: 0

Welbog
Welbog

Reputation: 60458

I'm not really sure what your aim is. Is your intention simply to share data between Wordpress and Wikia?

You should not store two unrelated schemas in one database. It's just asking for collisions. Both Wikia and Wordpress maintain their own schemas: they may name different functional database objects the same.

If you want to share data between the two databases, you can set up triggers and views to move data from one to the other without them being in the same database.

Upvotes: 0

KM.
KM.

Reputation: 103707

A host will put multiple clients on the same database server, so yes.

If you control the database and the apps, then you could code them to "share info"

Upvotes: 1

Amr Elgarhy
Amr Elgarhy

Reputation: 69042

Why not, its possible, just take care from any tables names conflict between both tables, you may need to edit some tables names.

And about populating one from another, i think you will need to edit its code some how to let it understand the new tables.

Upvotes: 1

Related Questions