Support » Plugin: SharDB » Shardb install on localhost WAMP

  • Resolved DolphinGuy


    Hello everyone,

    I continue my quest of creating a very large WPMU website. Therefore my need to use Shardb. I have Shardb installed on various beta websites in all three configurations 16, 256, 4096. Currently I am trying to install it locally on a localhost WAMP Server.

    I’ve been meet with the following stream of errors, which I have uploaded to my box account as follows.

    Fortunately this is not a life or death situation, I would just like to get it running locally – if that is at all possible.

    Any help on matter will surely be appreciated.


Viewing 8 replies - 1 through 8 (of 8 total)
  • Plugin Author Ron Rennick


    MultiSite Guru

    That link just gives a redirect loop for me. What are the first couple error messages?

    Hi Ron,

    Sorry for having not posted [Resolved] earlier, but I have been very busy. However, the issue of getting Shardb running locally has been resolved for some time now and Shardb has been working perfectly on several local installs.

    Again, many thanks for the great plugin.


    Plugin Author Ron Rennick


    MultiSite Guru

    You’re welcome.

    Hello Ron,

    I am managing a multisite subdomain multidatabase WordPress instance. This site is a development site in preparation for a production WordPress instance. SharDB does an excellent job of handling the multidatabase aspect of this WordPress instance. However, I have some questions to start with:
    1) In SharDB-2.7.6 the function add_shardb_migrate_page() contains the line “add_submenu_page( ‘settings.php’, ‘SharDB Migration’,…”. The file settings.php DOES NOT exist in the wp-admin directory. I was able to overcome this by substituting ms-admin.php for settings.php in this line. So, why does this line have settings.php in it?

    2) Immediately following the end of the above function is the line “add_submenu_page( ‘network_admin_menu’, ‘add_shardb_migrate_page’ );”. The only way I could get SharDB Migrate to appear ANYWHERE was to substitute admin_menu for network_admin_menu. Did you intend something of this sort?

    3) Did you intend SharDB to ensure that each site is stored in its own unique database? The SharDB site table migration function DOES NOT ensure this. I was eventually able to get each site into its own database by adjusting the SharDB site table migration function. However, once db.php has been added to the wp-content directory, SharDB migration is no longer available. In that case the addition of NEW sites seems to be handled by SharDB’s extension of WPDB via db.php.
    The shardb-admin.php file’s functionalities do not appear to come into play when adding a NEW site. Am I wrong about this?
    This leads me to the last question.

    4) When a new site is added by pressing “Add New” in WordPress Sites->Add New Site the chances are approximately 75% that the new site’s tables will be inserted into a database that ALREADY contains a previously created site’s tables. I can overcome this problem by repeatedly deleting the new site and re-adding it. It takes about three tries to get SharDB to insert the new site’s tables into an empty database. So, Ron, do you have any suggestions about resolving this issue?

    Thank you for producing a splendid plugin and thank you in advance for your help.


    Plugin Author Ron Rennick


    MultiSite Guru

    1) & 2) I know that needs to be fixed. It’s on my to do list.

    3) No, it isn’t designed to give each site it’s own DB. cPanel hosts do not allow the WordPress DB user permissions to create DBs so a feature like that is impractical for general use.

    The shardb-admin.php is only the migration tool and adds the Database column to the Network Admin -> Sites listing. You can remove it and SharDB works fine without it.

    4) Except home, VIP & global databases, SharDB uses 16, 256 or 4096 DBs (depending on how it is configured) regardless of how many sites you have.

    Thanks for answering these questions, Ron!

    I have made significant headway toward adapting SharDB, i.e. db.php, to actually insert any new site (which has been added via “Add New” in WordPress Sites->Add New Site) into it’s own unique database.

    For example, suppose there are 16 previously created databases (foodb_0 thru foodb_f). Further suppose that foodb_2, foodb_c, and foodb_f are all empty and contain no site tables. I have successfully adjusted dp.php to create the new site’s tables in the first available, i.e. empty database which in this case is foodb_2. SharDB then successfully populates the newly created tables by inserting the appropriate global table values into the corresponding site tables.

    Everything works fine up to this point. The only remaining hurdle is to overcome the fact that after the new site has been created and it’s tables have populated, in the WordPress->Sites “Dataset / Partition” column the new site is most likely labeled “foo / foodb_4” or some other already used and therefore unavailable database. In fact, since the new site’s tables were created in foodb_2 the column entry for the new site should be “foo / foodb_2”! Because WordPress “thinks” that the new site is in foodb_4, for all intents and purposes the new site and it’s site tables are unavailable.

    I can address this if you can answer this question:
    Do you know the method (or criteria) by which either WPDB of SharDB chooses the database in which to insert a new site? Knowing how the database is chosen will allow me to “tell” WordPress in which database the new site and it’s tables are actually located.

    Thank you, Ron,

    Hi again, Ron,

    Your mention of cpanel hosting surely makes sense as to why SharDB sn’t designed to give each site it’s own DB. However, the WordPress instance that I manage is hosted on our college’s own WordPress server. So, this being the case, I have undertaken the challenge of adjusting db.php to actually ensure that new sites and their site tables are placed in their own unique database.


    Are you able to provide a download link to your modified version that creates new tables for each blog? I’m only guessing that by now you have answered your last questions and have everything working right, if so, it would be appreciated if you are able to share it.

Viewing 8 replies - 1 through 8 (of 8 total)
  • The topic ‘Shardb install on localhost WAMP’ is closed to new replies.