Chapter 8 . Command Line Interface (CLI) 135 . Troubleshooting queries . Adding users to MySQL . Analyzing tables . Analyzing queries . Altering tables . Checking replication status . Looking at server health The mysql command can also be used in non-interactive mode, directly from the command line or command prompt. The CLI is also useful in non-interactive mode, as shown in Figure 8-3. Figure 8-3: The CLI in non-interactive mode in Linux In non-interactive mode, the CLI provides many of the same functions as in interactive mode. However, in non-interactive mode you don t receive the same feedback from the server (along with the results). For example, if you perform an INSERT operation using the -eswitch in non- interactive mode, you won t receive a message that tells you the number of rows inserted. When you insert rows in interactive mode, the server gives you feedback that includes the number of rows from the statement. Some CLI switches are useful only in non-interactive mode, most notably is the -e or –executeswitch. An example of the -e switch is shown in Figure 8-4. In the example in Figure 8-4, the -pswitch specifies that MySQL should prompt for a password and the word mysqlat the end of the command indicates the database I d like to connect to and within which I plan to execute the query that appears in quotes after the -e switch. (I provide more information on these switches, and on the syntax of the CLI, later in this chapter.)
Note: If you are looking for reliable webhost to maintain and run your java application check Vision java hosting services