MySQL commands with batch files

July 12, 2009 at 08:25:07
Specs: Server 2003, XEON 2.8 GHz Two Processors - 2 GB RAM
I was wondering if it was possible to get the current list of tables, within MySQL, and then do a OPTIMIZE TABLE `name`?

So I need to store the name in a variable, I figure, then do some sort of loop for each name?

Or, if possible, get the batch file to open up a internet explorer page and once it's done loading / after about 20 seconds it can kill the process?


See More: MySQL commands with batch files

Report •

July 13, 2009 at 04:42:11
The mysqlshow command will give you a list of tables.

mysqlshow databasename

You can script mysql functions by passing the sql part with -e

mysql databasename -e "SQL CODE HERE"

Have a look at the supplied documentation for additional details.

Report •

July 15, 2009 at 10:16:21
mysqlcheck --optimize --all-databases or --databases [db_name}

mysqlshow [options] [db_name]

Report •

Related Solutions

Ask Question