Computing.Net > Forums > Programming > MySQL commands with batch files

Computer Problems? Computing.Net has over 1,000,000 posts about all things technology related! Over 90% answered within 24 hours! Click here to start participating now! Also, be sure to check out the New User Guide.

MySQL commands with batch files

Reply to Message Icon

Name: Diablosblizz
Date: July 12, 2009 at 08:25:07 Pacific
OS: Server 2003
CPU/Ram: XEON 2.8 GHz Two Processors - 2 GB RAM
Subcategory: Batch
Comment:

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?

Thanks!



Sponsored Link
Ads by Google

Response Number 1
Name: David Perry
Date: July 13, 2009 at 04:42:11 Pacific
Reply:

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.


0

Response Number 2
Name: Nnyan
Date: July 15, 2009 at 10:16:21 Pacific
Reply:

mysqlcheck --optimize --all-databases or --databases [db_name}

mysqlshow [options] [db_name]


0

Sponsored Link
Ads by Google
Reply to Message Icon

Related Posts

See More


running multiple batch microsoft visual basic 20...



Post Locked

This post is quite old and has been locked from receiving new replies. Please create a new posting instead.


Go to Programming Forum Home


Sponsored links

Ads by Google


Results for: MySQL commands with batch files

Get last line with batch file www.computing.net/answers/programming/get-last-line-with-batch-file/17019.html

editing text file with batch file www.computing.net/answers/programming/editing-text-file-with-batch-file/15231.html

Delete blank lines with batch file? www.computing.net/answers/programming/delete-blank-lines-with-batch-file/13018.html