Using the mysql Client to Export Data : MySQL « Command MySQL « SQL / MySQL






Using the mysql Client to Export Data

       

% mysql -e "SELECT account, shell FROM passwd" -N myDatabase > shells.txt

   
    
    
    
    
    
    
  








Related examples in the same category

1.mysql Options
2.mysql Commands
3.Processing SQL Files with mysql
4.Change default-character-set for backup
5.Connect to the mysql database as the root user from the MySQL CLI
6.Connects the root account to the inventory database:
7.Connect to the MySQL database as root
8.Import a SQL-format dump file back into MySQL
9.If you dumped tables from a single database, you'll need to tell mysql which database to import them into
10.Verify whether the MySQL databases have been properly installed and configured.
11.Specify the user for mysql
12.To operate the mysql client utility in the context of the root user.
13.Specify a database when you start the mysql utility
14.To invoke mysql interactively from the command line, specify any necessary connection parameters after the command name
15.Provide a database name to select that database as the default database
16.Restoring a Single Database
17.Restoring Several Databases
18.Restoring a Database
19.Recreate the database in interactive mode:
20.Connect to the sampdb database on the local host and on cobra.snake.net:
21.Telling mysql to Read Queries from a File
22.MySQL Server and Included Administrative Tools
23.Common Options of the MySQL Client Tools
24.Producing HTML Output
25.Producing XML Output
26.Launching mysql with the option --silent:
27.XML Exporting with mysql
28.Sign into the MySQL server as root
29.The options part of the mysql command line might be empty
30.To determine the version of a program, use the --version option.
31.To determine the options supported by any MySQL program, invoke the program with the --help option.
32.Try out the various communication protocols
33.Find out which options will be taken from option files by mysql, use this command
34.Specifying Queries on the Command Line
35.To run multiple queries with the -e option, separate them with semicolons:
36.Getting Server Metadata
37.Produce output in formats other than tab-delimited
38.The prompt command supports a number of options that allow you to display the mysql prompt in various ways.
39.To connect to a server running on some other machine, it's necessary to specify the hostname using an -h option.
40.In many cases, a given option has both a long and a short form.
41.Connect with the same options as the previous example, but using the corresponding short option forms:
42.Generating HTML Tables