Home >Database >Mysql Tutorial >What are the common parameters of the mysql command?

What are the common parameters of the mysql command?

下次还敢
下次还敢Original
2024-04-14 20:36:341061browse

MySQL commands provide various parameters for customizing their functions and behaviors, including: User authentication: -u specifies the username, -p prompts for a password, --password specifies the password directly. Connection: -h specifies the host address, -P specifies the port number. Database selection: -D selects the database to connect to. Query execution: -e executes the query directly, -f disables newlines, and -s formats the results in a table. Query output: -o outputs results to a file, --html formats results in HTML format. Miscellaneous: --help displays help information, --verbose and -vv enable verbose output.

What are the common parameters of the mysql command?

Common parameters for MySQL commands

The MySQL command provides a series of parameters to customize its functionality and behavior. The most commonly used parameters are listed below:

User authentication parameters:

  • -u : Specify Username used to connect to the database.
  • -p: Prompts for user password.
  • --password=:Specify the user password directly.

Connection parameters:

  • -h : Specify the MySQL to connect to Host address.
  • -P : Specify the MySQL server port number to connect to.

Database selection parameters:

  • -D : Immediately after connecting to the MySQL server Select the specified database.

Query execution parameters:

  • -e : Directly execute the specified SQL query.
  • -f: Disable newlines for results.
  • -s: Format the results in table form.

Query output parameters:

  • -o : Output the query results to the specified document.
  • --html: Format query results in HTML format.

Miscellaneous parameters:

  • --help: Display help information about MySQL commands.
  • --verbose: Enable verbose output.
  • -vv: Enable more verbose output.

The above is the detailed content of What are the common parameters of the mysql command?. For more information, please follow other related articles on the PHP Chinese website!

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn