Forums

[resolved] 2 databases (1 for user info. & 1 for other tables) (7 posts)

  1. netpooyan
    Member
    Posted 3 years ago #

    I want to have 4 different blogs in 4 different folders and also subdomains and i want to use 4 different databases (1 for each blog) and 1 other database to keep user informations of all blogs and other pages of website in it to have the same user database for all the pages in website. (I want to use 4 databases for better performance and also one different database for user informations to use it for other parts of website.)

    Is there anyway to change wp_db to be able to read from 2 databases at the same time (user database for user informations and WP database for blog info.)? (I'm noobie in using PHP classes and i can't understand it a lot.)

  2. MichaelH
    Volunteer
    Posted 3 years ago #

  3. netpooyan
    Member
    Posted 3 years ago #

    ThanX MichaelH for your help,

    I read them but all the answers was about using one database for multiple blogs. My question is for example, is there anyway to use two databases for one blog? one for users information talebs (two tables that contain users information in WP) and one for other WP tables (like posts, plugings, settings).

    I need to use two databases for each blog because i need to have one different database for members informations to use it in other pages of website (instead of blogs) and also to use them for all the WP blogs.

    I have made one database named "database1" that has two tables consist of usernames and user informations, and another database named "database2" for other tables.
    I'm noobie in using classes so i can't understand how to change wp_db class to get user informations from database1 and get posts and plugings and ... from database2.

    PS: sorry for my poor English, and thanks for your help.

  4. MichaelH
    Volunteer
    Posted 3 years ago #

    I don't think you can do it the way you want.

    I would encourage you to look at using one database for everything including your non-WordPress application. With the use of the $table_prefix in wp-config.php you could put 100 WordPress blogs in one database.

    Even if you do use one database, if you want to 'share' users across blogs you will want to follow Otto's advice in the link provided above.

    And please, no apologies for your English--it's very good!

  5. netpooyan
    Member
    Posted 3 years ago #

    ThanX MichaelH,

    Sorry for asking too much questions and thanks for your useful help. :)

    Another question that i have is:
    Wich one is better (better performance) for websites with tons of visitors? Using one database or multiple databases?
    For websites with a lot of visitors does one database be able to handle everything without crashing (or also causing the pages load slower)?
    I have installed about 10 plugings on each blog and they use database too and also if i use WP database for storing user informations other pages of website will use that database for user informations too and i donno if they will be able to work properly for huge website trafic in the future.

  6. MichaelH
    Volunteer
    Posted 3 years ago #

  7. netpooyan
    Member
    Posted 3 years ago #

    Thanks a lot. :)

Topic Closed

This topic has been closed to new replies.

About this Topic