Home  >  Article  >  Database  >  Call MySQL program

Call MySQL program

WBOY
WBOYforward
2023-08-29 09:45:06899browse

Call MySQL program

#MySQL programs can be called from the command line (that is, from a shell or command prompt).

How to call?

This can be done by entering the program name, followed by any options or parameters needed to instruct the program to do what the user wants.

The following commands show some sample program calls. 'shell>' represents the command interpreter prompt; this is not part of the user input. The specific prompt users see depends on their command interpreter.

Typical prompts are $ (representing sh, ksh or bash), % (representing csh or tcsh) and C:\> (representing Windows command.com or cmd) .exe command interpreter.

Query

shell> mysql −−user=root test
shell> mysqladmin extended−status variables
shell> mysqlshow −−help
shell> mysqldump −u root personnel

Parameters starting with a single dash or double dash (−, −−) specify program options. The

option usually indicates the type of connection that a program that should make with or affect its server should make. operating mode.

Non-option parameters, i.e. parameters without a leading dash, provide additional information to the program.

Example

The mysql program interprets the first non-option parameter as the database name, which means that the command mysql --user=root test indicates that the user wants to use the test database.

Some options are common to many programs.

The most commonly used options are the --host (or -h), --user (or -u) and --password (or -p) options that specify connection parameters. These options represent the host on which the MySQL server is running, as well as the username and password for the user's MySQL account.

The above is the detailed content of Call MySQL program. For more information, please follow other related articles on the PHP Chinese website!

Statement:
This article is reproduced at:tutorialspoint.com. If there is any infringement, please contact admin@php.cn delete