dufault.info

Ramblings of a phone weenie, Linux sysadmin, and other things geeky

17  07 2008

Scripts To Make Administrating Lots of MySQL Databases a Little Easier

This post is probably only helpful to a system administrator of large shared servers that happen to have a lot of MySQL databases.

These scripts are meant to administrate all of the databases and tables on a single server currently, I might refine them to also work only database or table name’s supplied.

One of the scripts, tableCheck, will access mysql using the username and password in /root/.mysql.cnf, and run a “check table $name” command, and error out if a table has been corrupted.

Another of the scripts, probably a bit heavy-handed, tableRepair, doing the same thing as tableCheck only running a repair query.

tableOptimize runs a “optimize table $name” query on all tables available, which is nice to do occasionally to speed up queries due to nasty things like table fragmentation.

Lastly, findLargeDatabases is a simple script that’ll show you the largest databases you have in order of size, so you can refine your efforts to optimizing those.

Here’s the goods!
scripts.tgz

Share and Enjoy:
  • Digg
  • del.icio.us
  • Mixx
  • StumbleUpon
  • Technorati

No Comments

(Required)
(Required, will not be published)

This site uses KeywordLuv. Enter YourName@YourKeywords in the Name field to take advantage.

« Forcibly Triggering a Kernel Panic on Linux The Linux Magic SysRq key »