Use Option parameters on the command line
There are several principles for using options in the command line:
(1) The option is followed by the command name.
(2) There are two options: Long Name and short name.
Shell long name format: mysql-uroot-p -- execute = "select * from user" testdb
Shell short name format: mysql-uroot-p-e "select * from user" testdb
(3) Command Options are case sensitive.
Use Option files
MySQLProgramYou can read the startup options from the options file (also known as the configuration file. The option file provides a convenient way to specify common options. Therefore, you do not need to enter the option from the command line each time you run the program.
In shell scripts, you can use the my_print_defaults program to analyze the option file. Print the options in the clien and MySQL groups as follows:
In UNIX, the MySQL program reads startup options from the following files:
(Refer to the MySQL official documentation ).