You can catch the output in a file for further processing : mysql « MySQL Utilities « MySQL Tutorial






shell> mysql < batch-file > mysql.out








26.3.mysql
26.3.1.To see a list of options provided by mysql, invoke it with the --help option:
26.3.2.Logging In with mysql
26.3.3.Remote Client Connection
26.3.4.If you are logging in on the same machine that MySQL is running on, you can omit the host.
26.3.5.If anonymous (unnamed) user is allowed, you should be able to connect to that server by invoking mysql without any options:
26.3.6.Supply your password on the command line after the -p option.
26.3.7.You can select the database on the command line when you invoke mysql.
26.3.8.Non-Interactive Commands
26.3.9.Using mysql in Batch Mode
26.3.10.To escape some special characters in the file
26.3.11.If you need to specify connection parameters on the command line in batch mode
26.3.12.Continue even if errors in batch mode, you should use the --force command-line option
26.3.13.Run the output through a pager
26.3.14.You can catch the output in a file for further processing
26.3.15.Use scripts from the mysql prompt by using the source command or \. command