Chapter 11. Using an Options File
Over the course of this book, you’ve seen that you can
pass options to many of the programs and scripts that are part of the
MySQL distribution. For example, you can pass the user
and password
options to the MySQL monitor. If you
don’t specify a value for an option, the default options are used. For
example, most client programs try to use the default values localhost
and 3306
for the server host
and port
options, respectively.
If you need to use an option value that’s not the default, you
have to specify it each time you run a program that needs that option;
this is tedious and prone to errors. Fortunately, you can save option
values to an options file, also sometimes called a
configuration file, that most of the key MySQL
programs and scripts can read. The programs that read options files
include: myisamchk
, myisampack
, mysql
, mysqladmin
, mysqlbinlog
, mysqlcc
, mysqlcheck
, mysqld
, mysqld_safe
, mysqldump
, mysqlhotcopy
, mysqlimport
, mysql.server
, and mysqlshow
.
We’ll start our tour of options files with an example using the MySQL monitor.
Get Learning MySQL now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.