Home > Database > Mysql Tutorial > How to specify options for MySQL program?

How to specify options for MySQL program?

王林
Release: 2023-09-02 17:21:02
forward
1245 people have browsed it

How to specify options for MySQL program?

Let us understand how to specify options in MySQL program. There are several ways to specify options for a MySQL program −

Command line

After entering the program name, the options on the command line must be listed. This is a common procedure that applies to specific program calls.

Option file

You also need to list the options in the option file that the program reads when it starts. This is a common step where users need options every time the program is run.

Environment variables

Need to list the options in the environment variables. This approach is very helpful for options that require the user to apply the option every time they run the program.

In real life, option files are more commonly used for this purpose, they can also be used to run multiple MySQL instances on Unix.

Options are processed sequentially. This means that if an option is specified multiple times, the last occurrence of that option will take precedence.

The following command will cause mysql to connect to a server running on localhost −

mysql −h example.com −h localhost
Copy after login

The MySQL program determines which options are provided first by examining environment variables. Then, process the options file by examining the command line.

Since later options take precedence over earlier options, the order of processing means that environment variables have the lowest priority and command line options have the highest priority.

The above is the detailed content of How to specify options for MySQL program?. For more information, please follow other related articles on the PHP Chinese website!

source:tutorialspoint.com
Statement of this Website
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
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template