| CARVIEW |
The world's most popular open source database
- Documentation Library
- Table of Contents
- MySQL 6.0 Reference Manual
- MySQL 5.1 Reference Manual
- MySQL 5.0 Reference Manual
- MySQL 3.23/4.0/4.1 Manual
- Table of Contents
- Preface
- 1 General Information
- 2 Installing and Upgrading MySQL
- 3 Tutorial
- 4 MySQL Programs
- 5 MySQL Server Administration
- 6 Backup and Recovery
- 7 Optimization
- 8 Language Structure
- 9 Internationalization and Localization
- 10 Data Types
- 11 Functions and Operators
- 12 SQL Statement Syntax
- 13 Storage Engines
- 14 High Availability and Scalability
- 15 MySQL Enterprise Monitor
- 16 Replication
- 17 MySQL Cluster
- 18 Stored Programs and Views
- 19 INFORMATION_SCHEMA Tables
- 20 Connectors and APIs
- 21 Extending MySQL
- A MySQL 5.0 Frequently Asked Questions
- B Errors, Error Codes, and Common Problems
- C MySQL Enterprise Release Notes
- D MySQL Community Server Enhancements and Release Notes
- E MySQL Change History
- F Restrictions and Limits
- Index
Table of Contents [+/-]
- 3.1. Connecting to and Disconnecting from the Server
- 3.2. Entering Queries
- 3.3. Creating and Using a Database [+/-]
- 3.4. Getting Information About Databases and Tables
- 3.5. Using mysql in Batch Mode
- 3.6. Examples of Common Queries [+/-]
- 3.6.1. The Maximum Value for a Column
- 3.6.2. The Row Holding the Maximum of a Certain Column
- 3.6.3. Maximum of Column per Group
- 3.6.4. The Rows Holding the Group-wise Maximum of a Certain Field
- 3.6.5. Using User-Defined Variables
- 3.6.6. Using Foreign Keys
- 3.6.7. Searching on Two Keys
- 3.6.8. Calculating Visits Per Day
- 3.6.9. Using
AUTO_INCREMENT
- 3.7. Queries from the Twin Project [+/-]
- 3.8. Using MySQL with Apache
This chapter provides a tutorial introduction to MySQL by showing how to use the mysql client program to create and use a simple database. mysql (sometimes referred to as the “terminal monitor” or just “monitor”) is an interactive program that allows you to connect to a MySQL server, run queries, and view the results. mysql may also be used in batch mode: you place your queries in a file beforehand, then tell mysql to execute the contents of the file. Both ways of using mysql are covered here.
To see a list of options provided by mysql,
invoke it with the --help option:
shell> mysql --help
This chapter assumes that mysql is installed on your machine and that a MySQL server is available to which you can connect. If this is not true, contact your MySQL administrator. (If you are the administrator, you need to consult the relevant portions of this manual, such as Chapter 5, MySQL Server Administration.)
This chapter describes the entire process of setting up and using a database. If you are interested only in accessing an existing database, you may want to skip over the sections that describe how to create the database and the tables it contains.
Because this chapter is tutorial in nature, many details are necessarily omitted. Consult the relevant sections of the manual for more information on the topics covered here.


User Comments
Add your own comment.