
- Learn MySQL
- MySQL - Home
- MySQL - Introduction
- MySQL - Installation
- MySQL - Administration
- MySQL - PHP Syntax
- MySQL - Connection
- MySQL - Create Database
- MySQL - Drop Database
- MySQL - Select Database
- MySQL - Data Types
- MySQL - Create Tables
- MySQL - Drop Tables
- MySQL - Insert Query
- MySQL - Select Query
- MySQL - Where Clause
- MySQL - Update Query
- MySQL - Delete Query
- MySQL - Like Clause
- MySQL - Sorting Results
- MySQL - Using Join
- MySQL - NULL Values
- MySQL - Regexps
- MySQL - Transactions
- MySQL - Alter Command
- MySQL - Indexes
- MySQL - Temporary Tables
- MySQL - Clone Tables
- MySQL - Database Info
- MySQL - Using Sequences
- MySQL - Handling Duplicates
- MySQL - SQL Injection
- MySQL - Database Export
- MySQL - Database Import
Invoking MySQL Programs
A MySQL program can be invoked from the command line (i.e, from your shell or command prompt).
How to invoke?
This can be done by entering the program name followed by any options or arguments that would be needed to instruct the program to do what the user wants.
The below commands show some sample program invocations. The ‘shell>’ represents the prompt for the command interpreter; which is not part of what the user types. The specific prompt seen by user depends on their command interpreter.
Typical prompts are $ for sh, ksh, or bash, % for csh or tcsh, and C:\> for the Windows command.com or cmd.exe command interpreters.
Query
shell> mysql −−user=root test shell> mysqladmin extended−status variables shell> mysqlshow −−help shell> mysqldump −u root personnel
Arguments which begin with a single or double dash (−, −−) specify the program options.
Options usually indicate the connection type of a program that should be made to the server or to affect its operational mode.
Nonoption arguments, i.e arguments which don’t have a leading dash, provide additional information to the program.
Example
The mysql program interprets the first nonoption argument as a database name, which means that the command mysql −−user=root test indicates that the user would want to use the test database.
Some options are common to many of the programs.
The most frequently used options are the −−host (or −h), −−user (or −u), and −−password (or −p) options which specify connection parameters. These options indicate the host where the MySQL server is running, and the user name and the password of the user’s MySQL account.
- Related Articles
- MySQL Client Programs
- Overview of MySQL Programs
- MySQL Installation Related Programs
- MySQL Administrative and Utility Programs
- MySQL Server and Server-Startup Programs
- Self–invoking function in JavaScript?
- How to specify options for MySQL programs?
- Application Programs vs System Programs
- Using Options on the Command Line for MySQL programs?
- What are Self-Invoking Anonymous Functions in JavaScript?
- Invoking functions with call() and apply() in JavaScript
- What kinds of programs are available in MySQL database to manage MySQL server?
- Using Option Files for MySQL programs? Usage of Option Files
- Structuring Python Programs
- C/C++ Tricky Programs
