I like to request a new plugin for multidb user :). Optimizing each database is tedious. Plus I don't know how to mass optimize all 256 databases at the same time. I wonder if it's possible for a developer here to create an optimize plugin that allows wpmu + multidb owners to do one click to optimize all databases? For example: There will be options where wpmu+multidb owners get to pick to match up how many databases they have and want to optimize, such as 16, 256, and 4096.
I like to request a new plugin for multidb user :). Optimizing each database is tedious. Plus I don't know how to mass optimize all 256 databases at the same time. I wonder if it's possible for a developer here to create an optimize plugin that allows wpmu + multidb owners to do one click to optimize all databases? For example: There will be options where wpmu+multidb owners get to pick to match up how many databases they have and want to optimize, such as 16, 256, and 4096.
Plug in the details for the global database towards the top. Run it manually to make sure it gets all of them. The usernames, hostnames, and passwords will all have to be the same.
I am sstill using a very old script you posted a couple of years back on the regular wpmu forums to cleanup/optimize all DBs, if you happen to rememebr what I am talking about, can you post that again so I can check if I have the latest version?
otherwise I'll have to check from home and post it here so you know what I am talking about :-)
btw. not using multiple DBs so the old script worked just fine for me...
Ok, I know this post has been around for 9 months with no updates. I am interested to know if there is any way to optimize tables easily with multi db installed. Thanks
Ok, I know this post has been around for 9 months with no updates. I am interested to know if there is any way to optimize tables easily with multi db installed. Thanks
LOL, and here I'm back again to question if anyone has find a solution for this very problem yet? Recently I ran mysqltuner.pl script and find out that I've so many fragmented tables that it scares me to death! Thinking of optimizing 4096 databases of tables, wow, how consuming this will be if one has to do one by one. Any alternative solution?
Responses (15)
Erstwhile founder — 18th August 2009 (2 years ago) #
Hiya,
That's really something that shouldn't be handled by a plugin. A script maybe, but WP/WPMU shouldn't be loaded just to optimize a database.
Thanks,
Andrew
Keeper of the Dark Chocolate — 18th August 2009 (2 years ago) #
I know we've talked about this previously but here's a new link:
http://cynix.uni.cc/extrastuff/optimizemassdatabases.txt
Plug in the details for the global database towards the top. Run it manually to make sure it gets all of them. The usernames, hostnames, and passwords will all have to be the same.
Hope this helps,
-drmike
Member — 19th August 2009 (2 years ago) #
drmike, the link is not working
Member — 19th August 2009 (2 years ago) #
@drmike:
I am sstill using a very old script you posted a couple of years back on the regular wpmu forums to cleanup/optimize all DBs, if you happen to rememebr what I am talking about, can you post that again so I can check if I have the latest version?
otherwise I'll have to check from home and post it here so you know what I am talking about :-)
btw. not using multiple DBs so the old script worked just fine for me...
Keeper of the Dark Chocolate — 4th July 2010 (1 year ago) #
Someone bump this for me Monday please and I'll see what I can find. (Wait a few hours though as I'm online for a few more hours.)
Member — 5th April 2011 (1 year ago) #
Ok, I know this post has been around for 9 months with no updates. I am interested to know if there is any way to optimize tables easily with multi db installed. Thanks
Member — 5th April 2011 (1 year ago) #
Ok, I know this post has been around for 9 months with no updates. I am interested to know if there is any way to optimize tables easily with multi db installed. Thanks
Member — 28th May 2011 (12 months ago) #
LOL, and here I'm back again to question if anyone has find a solution for this very problem yet? Recently I ran mysqltuner.pl script and find out that I've so many fragmented tables that it scares me to death! Thinking of optimizing 4096 databases of tables, wow, how consuming this will be if one has to do one by one. Any alternative solution?
Member — 3rd June 2011 (11 months ago) #
Would optimize global database is more important than all other databases that created by multi-db process?
Member par excellence — 14th November 2011 (6 months ago) #
Run from SSH :)
mysqlcheck -u root -p --auto-repair --check --optimize --all-databases
I have set this up as a bash scrip and running it from cron every day at 3 works like a charm.
Thx
Mark
Member — 2nd December 2011 (5 months ago) #
I have pasted drmike's script on pastebin: http://pastebin.com/sm9x6gK8
I have been using it for years but after the latest mysql upgrade I am now getting warnings like this when running it:
PHP Deprecated: mysql_db_query(): This function is deprecated; use mysql_query() instead in /root/optimize_dbs on line 30can I simply replace mysql_db_query with mysql_query to fix it? anyone willing to help out here?
p.s. to run it type "php optimize_dbs" in your console.
Member — 31st January 2012 (3 months ago) #
can anyone with mysql/php knowledge help me sort this out please?
Member — 11th February 2012 (3 months ago) #
*pretty please* ? this should be no biggy but I suspect it gets overlooked :-(
Member — 9th April 2012 (1 month ago) #
@Mark: Any idea why a few particular tables are complaining?
I am using:
mysqlcheck --all-databases --auto-repair --extended --check --optimize -uroot -p*****@everyone else: any help with the above linked script?
Member — 9th April 2012 (1 month ago) #
Innodb tables: http://dev.mysql.com/doc/refman/5.1/en/optimize-table.html
I copied the script. If I ever play around with it I`ll post my changes.
Become a member