Database Reference
In-Depth Information
CHAPTER 1
Using the mysql Client Program
1.0. Introduction
The MySQL database system uses a client-server architecture. The server, mysqld , is the
program that actually manipulates databases. To tell the server what to do, use a client
program that communicates your intent by means of statements written in Structured
Query Language (SQL). Client programs are written for diverse purposes, but each
interacts with the server by connecting to it, sending SQL statements to have database
operations performed, and receiving the results.
Clients are installed locally on the machine from which you want to access MySQL, but
the server can be installed anywhere, as long as clients can connect to it. Because MySQL
is an inherently networked database system, clients can communicate with a server
running locally on your own machine or somewhere on the other side of the planet.
The mysql program is one of the clients included in MySQL distributions. When used
interactively, mysql prompts you for a statement, sends it to the MySQL server for ex‐
ecution, and displays the results. mysql also can be used noninteractively in batch mode
to read statements stored in files or produced by programs. This enables use of mysql
from within scripts or cron jobs, or in conjunction with other applications.
This chapter describes mysql 's capabilities so that you can use it more effectively:
• Setting up a MySQL account for using the cookbook database
• Specifying connection parameters and using option files
• Executing SQL statements interactively and in batch mode
• Controlling mysql output format
• Using user-defined variables to save information
 
Search WWH ::




Custom Search