MySQL Command-Line Tool

Windows BAT file that executes the MySQL command-line tool. Copy this code to a file (for example, mysql.bat) and double click on the file.

@echo off
rem =========================================================
rem Execute MySQL Command-Line Tool
rem =========================================================

set MYSQL=C:\xampp\mysql\bin\mysql.exe

%MYSQL% --table -h localhost -u root -p<adminpassword>

pause

To executing SQL statements in a text file use the source command.

mysql> source filename