Archive for May, 2007

Java web server

Thursday, May 3rd, 2007

148 Part II . SQL Essentials Note If the pageroption is set in a MySQL configuration file, you can turn it off by using the –no-pager switch on the command line. Displaying query results vertically Often the columns in a query result wrap awkwardly around the edges of the screen. Not only is this situation ugly, it s also confusing; the wrapping makes the columns hard to match with their values, as shown in Figure 8-20. Figure 8-20: Without the vertical option, the output from this query wraps around the screen. In Figure 8-20, it can be difficult to determine whether a given user actually has the File privilege. However, with the use of the -Eor –verticalswitch, the data is displayed with columns following each other vertically. Adding the verticaloption to the .my.cnffile in my home directory along with the use of a pager command greatly improved the look and usability of my query s output (as shown in Figure 8-21). Figure 8-21: Using the vertical option and the pager option to make the output more comprehensible
Note: If you are looking for cheap and reliable webhost to host and run your mysql application check Vision professional web hosting services

Freelance web design

Thursday, May 3rd, 2007

Chapter 8 . Command Line Interface (CLI) 147 Speeding startup of the CLI When the CLI starts, it reads in table information to allow for completion, which can sometimes slow the startup. To turn off this default and get a quicker CLI startup, use the -A or –no-auto-rehashswitch. Adding –no-auto-rehash to the MySQL configuration file under the [mysql] section makes this quicker startup permanent. Making the CLI quieter When you start the CLI, a welcoming message prints (along with version and session information). In addition, status messages appear on-screen so you can see the progress of the statements you execute. If you d like to stop that information from showing up, use the -s or –silent option. To make this arrangement permanent (except for error messages, which still appear as needed), add the –silent option under the [mysql] section of your MySQL configuration file. Using a pager to work with larger amounts of data Often the results of a selectstatement scroll past the screen when the program has to handle a large (or not even very large) set of data. Through the use of the pager option you can set MySQL to return query results split over a number of screens. Using a pager command such as the more or less, you can control the scrolling on a page-by-page basis. You can set the pageroption, whether from inside a configuration file or on the command line, by adding the –pager=
option to the mysqlcommand, as shown in Figure 8-19. Figure 8-19: Using the –pager option on the command line specifies the program to control scrolling
Note: If you are looking for cheap webhost to host and run your apache application check Vision apache web hosting services

Web design tools

Thursday, May 3rd, 2007

146 Part II . SQL Essentials Figure 8-17: Using the –no-defaults option on the command line to override all defaults at once Performing a query shows that the other options (such as vertical and pager) have been turned off, as shown in Figure 8-18. Figure 8-18: A query with the defaults turned off yields the expected results. Using the CLI in Interactive Mode When you use the CLI in interactive mode, a prompt akin to a shell prompt appears you get functions, switches, and settings that affect how the CLI operates. Some of these features are better used with the CLI in non-interactive mode; others work more efficiently in interactive mode. When using the MySQL CLI in interactive mode, all commands must be terminated with a semicolon (;). The only three exceptions to this rule are the exit command, the quit command, and the connect command. Note
Note: If you are looking for high quality webhost to host and run your jsp application check Vision jsp web hosting services

Graphic web design

Wednesday, May 2nd, 2007

Chapter 8 . Command Line Interface (CLI) 145 Figure 8-15: Using mysql –print-defaults to see the default options I have for this client Performing a query with these options yields the results shown in Figure 8-16. Figure 8-16: Running a query with the default options However, now I have to connect to another MySQL server and I don t want the vertical or pager options but I do need column names printed. To turn off all the defaults at once and set my own, basing them on the new host I use the –no-defaults option (as shown in Figure 8-17).
Note: If you are looking for high quality webhost to host and run your jsp application check Vision florida web design services

Web hosting company

Tuesday, May 1st, 2007

144 Part II . SQL Essentials Table 8-1 Frequently Used MySQL CLI Variables Variable Use socket Changes the socket for local connections. port Changes the port for connections via TCP/IP. password Sets the password to be used by the CLI. Potential security risk. pager Sets the pager such as the more or less commands to control scroll. host Sets a default host to connect to with all connections. database Sets a default database. skip-column-names Suppresses the printing of column names with the select statements. vertical Prints output from queries vertically. html Produces output in HTML format, useful when operating in non-interactive mode. tee= Appends output from interactive mode into the file named . When calling the MySQL program, you can set its variables either in the .my.cnf file or on the command line. Tip Variables set on the command line supersede those set in configuration files. In addition to setting variables, a –no-defaultscommand-line option enables you to override any defaults in configuration files. This is useful if your .my.cnffile has a number of default values set, and you want to override them all to use some non-default options. In Figure 8-15, for example, I have set some options that enable me to work more efficiently (since most of the work is done on the local machine).
Note: If you are looking for cheap webhost to host and run your apache application check Vision apache web hosting services

How to cite a web site

Tuesday, May 1st, 2007

Chapter 8 . Command Line Interface (CLI) 143 Figure 8-13: The –print-defaults switch now shows the new defaults that go into effect the next time you start the MySQL CLI. In the example in Figure 8-13, I changed the socket to a bogus filename that won t actually connect to the MySQL server. The result is the error message you see in Figure 8-14. Figure 8-14: The socket name I used doesn t exist; therefore I receive an error message when I try to connect. Some of the more useful client or CLI variables are shown in Table 8-1.
Note: If you are looking for best quality webspace to host and run your tomcat application check Vision shared web hosting services