How can i find the database where an user account is located?

I need to know how can i obtain the database where some user's tables are located, because now I have 256 databases with the tables of the users

Thank you in advanced


  • mindset

    Hey Ash,

    I just wanted to raise an issue I uncovered when using the Multi-DB -- which is a great tool ---- but ......

    I originally configured for 256 DB -- because I expected that level of growth -- so I went through the effort and found your exact question one of the management issues that I did not resolve ----

    I also knew that I would eventually I would have to move to the cloud - in order to enjoy efficiency, and flexibility of virtual resources - and only pay for what I need.

    I have run some pretty big operations with 12+ physical servers, load balancers etc and traffic surges during launches and extreme growth can be a nightmare and costly - trying to keep ahead of the growth curve --- the cloud resolves those issues -----

    And so on the cloud -- you pay for instances or # of your applications running -- so you can have multiple virtual servers running your application instance to handle traffic -- and you pay based on size and quantity of instances that are fired up -- if traffic peaks -- it can automatically fire up another instance within minutes --

    To my point -- The DB also has instances -- separate from your application -- so if you were running a MU site -- you would have an instance fire up with your WP, and an instance for your DB minimally---

    if you have 256 DB's -- you would have to pay a minimum of 256 DB instances which would be outrageously expensive right out of the gate -- whereas with one DB ---- the cloud infrastructure -- would fire up more instances as needed --
    and thus you are only paying for what you need -- rather than for what you might need sometime in the future ---

    it handles all of the coordination and traffic balancing in the background ---

    Fortunately, I did this research before I got to deep into the 256 DB road -- which if you intend to stay on physical servers is probably be your best bet ---

    I would advise you -- that if you are going to expect huge growth -- the cloud is the way to go ----- Though there is a learning curve for cloud newgies -Managing cloud resources in a hyper-growth network of sites -- is so much easier in the cloud than dealing with physical server needs, adding load balancers, DB segmentation, and then having multiple servers sitting idle when not needed ---

  • Alexander


    Would you mind elaborating a bit here? Are you looking for a specific blog and need to know what db it resides in? If this is the case, may I ask why you need this? Multi-DB provides it's own database driver so in your code you can interact with the database just like you would normally. Using $wpdb will still work properly.

    There's also a way to add VIP blogs if you want to make sure particular blogs remain in a certain database. The config file has any example of how to do this.

    Or are you just looking for user data? If so, I'm pretty sure this is in the first database as it's a global table wp_users and isn't


    What you're getting at above isn't quite true. You don't need 256 database instances to run 256 databases.

    Multiple databases can be run from a single database server (instance) Shared hosting is a good example of this. There could be one MySQL server running which hold databases for hundreds of sites.

    Multi-DB just gives you the ability to spread your tables across many databases. But you could easily do 1 database server with all 256 dbs in it. You could also split this up and do 128 on 2 servers, or 64 on 4 servers.

    Best regards,

Thank NAME, for their help.

Let NAME know exactly why they deserved these points.

Gift a custom amount of points.