Web hosting services - 260 Part II . SQL Essentials Note Cross-
Wednesday, August 22nd, 2007260 Part II . SQL Essentials Note Cross- Reference Replication takes updates to data from one server and automatically copies them in real-time to another MySQL server. Chapter 18 covers replication. If you are not using replication, these functions are of no use. Exporting Data Two main methods are available for exporting data from a MySQL database: . mysqldump . the SELECT INTO OUTFILEstatement. Whether you re looking to make a simple backup of the server or export certain columns from a table into another program such as Microsoft Access, the exporting utilities and statements included with MySQL will help. You can also use a program called mysqlhotcopy to make a copy of a database. In addition, through the use of the MySQL CLI in non-interactive mode or with the Tee option, results can be saved or redirected into a file. mysqldump The mysqldump utility is a powerful program for extracting database and table structure along with the actual data. The mysqldumputility is sufficiently granular so that you could get the table structure and data from just one table or from all tables of all databases. If you would just like the table structure with no data you can do that as well. If you want just the data with no table structure, mysqldump also provides that functionality. The basic syntax for mysqldump is as follows: mysqldump [OPTIONS] database [tables] Cross- Reference Note When given no arguments, mysqldump simply prints a syntax reference. There are quite a few options with mysqldump. Some of the options and switches such as those for specifying the username and password have been discussed in other chapters. If you are unsure how to specify a username or password with MySQL utilities, please refer to Chapter 8 for more details. There are two variables that can affect your ability to dump tables with large columns: max_allowed_packet and net_buffer_length. Both can be set using the -Oor –set-variable switch on the mysqldump command line or in the MySQL configuration file. The mysqldump utility uses comments (escaped with /* */) to select options that may only be found in newer versions of MySQL. For example, when creating a
Looking for affordable and reliable webhost to host and run your business application? Then look no more and go to servlet web hosting services.