Chapter 10 . Databases (Tomcat web server) And Data 269 Figure

Chapter 10 . Databases And Data 269 Figure 10-37: Using the -A or –all-databases macro to dump the contents of all databases and data on the server. As you can see by Figure 10-37, all output was sent to the screen. Oops! If there were any large tables on the server, the output could have taken quite some time. Using mysqldumpavoids tying up the screen by redirecting the output to a file. As stated previously, in Linux you use the greater-than sign (>) to accomplish this redirection. For example, to rerun the –all-databases macro from the example in Figure 10-37, the command would be mysqldump -A -p > outfile.txt Performing that command produces a file that could be imported onto another server or servers to create a snapshot of the database server at that point in time. The file could also be used as a backup as well. Figure 10-38 shows another run of the command, followed by a look at the resulting data. The databases function The second macro-level function with mysqldumpis the –databases or -Bfunction. This option takes databases as arguments, producing the same type of output as the –all-databases macro. Specifically, the –databases function includes all DDL to create the database(s) and table(s) as well as the USE statements to connect to those new databases. The difference between the –databases and
Looking for affordable and reliable webhost to host and run your business application? Then look no more and go to servlet web hosting services.

Leave a Reply