Take the 2-minute tour ×
WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. It's 100% free, no registration required.

Well I have asked this question in WP Forums, StackOverflow, and GoDaddy community as well, but nothing worked out. Hoping something is in here.

I used 2 separated subdomains for my blog and site (2separate SQL database). But not I cudn't maintain separately so trying to merge them into a single WP driven site. If I do that, I will end up with limitation of max 1GB SQL DB set by GoDaddy (and I can't purchase dedicated solutions for this).

There is a way out to split a single DB into 2, or use more than 1 DB for WP. So, asking for you genius guys to help me out.

share|improve this question
3  
Use a host that isn't garbage... –  Wyck Jun 16 '11 at 1:34
    
1GB is a large database, how many posts / pages have you got?! –  addedlovely Jun 16 '11 at 8:34

2 Answers 2

Not 100% sure how your DB could get that big. Have you gone through and cleaned out post revisions, old rows in the wp_options table from old plugins, etc?

share|improve this answer
    
simply because of many posts and drafts, the database is larger. –  Ekendra Jun 16 '11 at 3:56
    
that's still very, VERY large. I have a site with over 2700 posts and the database isn't that large. I'd first go and make sure all post revisions are removed. –  Norcross Jun 22 '11 at 2:37

I have a working solution but it could seems a bit hackish. Put this code inside your wp-config.php and have fun! Note: You need to remove other occurences of define('DB_NAME') etc.

switch($_SERVER['HTTP_HOST'])
{
 case 'blog.example.com': 
{
    define('DB_NAME', 'database_1');
    define('DB_USER', 'user_for_db1');
    define('DB_PASSWORD', 'pwd_for_db1');
    define('DB_HOST', 'localhost');
    break;
}
 case 'www.example.com': 
{
    define('DB_NAME', 'database_2');
    define('DB_USER', 'user_for_db2');
    define('DB_PASSWORD', 'pwd_for_db2');
    define('DB_HOST', 'localhost');
    break;
}

The code above checks for $_SERVER['HTTP_HOST'] variable and switch db connection according to it.

Hope this helps!

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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