找回密码
 注册
搜索
热搜: 回贴
  • 前程无忧官网首页 有什么好的平台可以
  • 最新的销售平台 互联网营销的平台有哪
  • 制作网页的基本流程 网页制作和网页设
  • 【帝国CMS】输出带序号的列表(数字排
  • 网站建设公司 三一,中联,极东泵车的
  • 织梦 建站 织梦网站模版后台怎么更改
  • 云服务官网 哪些网站有免费的简历模板
  • 如何建网站要什么条件 建网站要用什么
  • 吉林市移动公司电话 吉林省退休人员网
  • 设计类毕业论文 网站设计与实现毕业论
查看: 6245|回复: 2

MySQL :: MySQL 5.0 Reference Manual :: 5.1.2 Server Command

[复制链接]
发表于 2009-11-29 02:32:19 | 显示全部楼层 |阅读模式 IP:江苏扬州
Recommended Servers for MySQL
The world's most popular open source database
Contact a MySQL Representative
Login | Register


MySQL.com
Downloads
Developer Zone
Partners & Solutions
Customer Login
DevZone
Documentation
Librarian
Articles
Forums
Bugs
Forge
Planet MySQL
Labs
   

Documentation Library
Table of Contents
MySQL 5.4 Reference Manual
MySQL 5.1 Reference Manual
MySQL 5.0 Reference Manual
MySQL 3.23/4.0/4.1 Manual
Search manual:
   


Additional languages
French
Spanish






MySQL 5.0 Reference Manual :: 5 MySQL Server Administration :: 5.1 The MySQL Server :: 5.1.2 Server Command Options
? 5.1.1 Server Option and Variable Reference


5.1.3 Server System Variables ?
Section Navigation      [Toggle]
5.1 The MySQL Server
5.1.1 Server Option and Variable Reference
5.1.2 Server Command Options
5.1.3 Server System Variables
5.1.4 Session System Variables
5.1.5 Using System Variables
5.1.6 Server Status Variables
5.1.7 Server SQL Modes
5.1.8 Server-Side Help
5.1.9 Server Response to Signals
5.1.10 The Shutdown Process
5.1.2.聽Server Command Options
When you start the mysqld server, you can specify program options using any of the methods described in Section聽4.2.3, 鈥淪pecifying Program Options鈥?/a>. The most common methods are to provide options in an option file or on the command line. However, in most cases it is desirable to make sure that the server uses the same options each time it runs. The best way to ensure this is to list them in an option file. See Section聽4.2.3.3, 鈥淯sing Option Files鈥?/a>.
MySQL Enterprise.聽 For expert advice on setting command options, subscribe to the MySQL Enterprise Monitor. For more information, see http://www.mysql.com/products/enterprise/advisors.html.
mysqld reads options from the [mysqld] and [server] groups. mysqld_safe reads options from the [mysqld], [server], [mysqld_safe], and [safe_mysqld] groups. mysql.server reads options from the [mysqld] and [mysql.server] groups.
An embedded MySQL server usually reads options from the [server], [embedded], and [xxxxx_SERVER] groups, where xxxxx is the name of the application into which the server is embedded.
mysqld accepts many command options. For a brief summary, execute mysqld --help. To see the full list, use mysqld --verbose --help.
The following list shows some of the most common server options. Additional options are described in other sections:
Options that affect security: See Section聽5.3.3, 鈥淪ecurity-Related mysqld Options鈥?/a>.
SSL-related options: See Section聽5.5.7.3, 鈥淪SL Command Options鈥?/a>.
Binary log control options: See Section聽16.1.2.4, 鈥淏inary Log Options and Variables鈥?/a>.
Replication-related options: See Section聽16.1.2, 鈥淩eplication and Binary Logging Options and Variables鈥?/a>.
Options specific to particular storage engines: See Section聽13.1.1, 鈥?code class="literal">MyISAM Startup Options鈥?/a>, Section聽13.5.3, 鈥?code class="literal">BDB Startup Options鈥?/a>, Section聽13.2.3, 鈥?code class="literal">InnoDB Startup Options and System Variables鈥?/a>, and Section聽17.4.2, 鈥?span>mysqld Command Options for MySQL Cluster鈥?/a>.
You can also set the values of server system variables by using variable names as options, as described at the end of this section.
--help, -?
Command Line Format-?
Config File Formathelp

Display a short help message and exit. Use both the --verbose and --help options to see the full message.
--allow-suspicious-udfs
Version Introduced5.0.3
Command Line Format--allow-suspicious-udfs
Config File Formatallow-suspicious-udfs
Permitted Values Typeboolean
DefaultFALSE


This option controls whether user-defined functions that have only an xxx symbol for the main function can be loaded. By default, the option is off and only UDFs that have at least one auxiliary symbol can be loaded; this prevents attempts at loading functions from shared object files other than those containing legitimate UDFs. This option was added in version 5.0.3. See Section聽21.2.2.6, 鈥淯ser-Defined Function Security Precautions鈥?/a>.
--ansi
Command Line Format--ansi
Config File Formatansi

Use standard (ANSI) SQL syntax instead of MySQL syntax. For more precise control over the server SQL mode, use the --sql-mode option instead. See Section聽1.7.3, 鈥淩unning MySQL in ANSI Mode鈥?/a>, and Section聽5.1.7, 鈥淪erver SQL Modes鈥?/a>.
--basedir=path, -b path
Command Line Format--basedir=name
Config File Formatbasedir
Option Sets VariableYes, basedir
Variable Namebasedir
Variable ScopeGlobal
Dynamic VariableNo
Permitted Values Typefilename


The path to the MySQL installation directory. All paths are usually resolved relative to this directory.
--big-tables
Command Line Format--big-tables
Config File Formatbig-tables
Option Sets VariableYes, big_tables
Variable Namebig-tables
Variable ScopeSession
Dynamic VariableYes
Permitted Values Typeboolean


Allow large result sets by saving all temporary sets in files. This option prevents most 鈥?span class="quote">table full鈥?errors, but also slows down queries for which in-memory tables would suffice. Since MySQL 3.23.2, the server is able to handle large result sets automatically by using memory for small temporary tables and switching to disk tables where necessary.
--bind-address=IP
Command Line Format--bind-address=name
Config File Formatbind-address
Permitted Values Typestring
Default0.0.0.0
Range0.0.0.0-255.255.255.255


The IP address to bind to. Only one address can be selected. If this option is specified multiple times, the last address given is used.
If no address or 0.0.0.0 is specified, the server listens on all interfaces.
--bootstrap
Command Line Format--bootstrap
Config File Formatbootstrap

This option is used by the mysql_install_db script to create the MySQL privilege tables without having to start a full MySQL server.
This option is unavailable if MySQL was configured with the --disable-grant-options option. See Section聽2.16.2, 鈥淭ypical configure Options鈥?/a>.
--character-sets-dir=path
Command Line Format--character-sets-dir=name
Config File Formatcharacter-sets-dir
Option Sets VariableYes, character_sets_dir
Variable Namecharacter-sets-dir
Variable ScopeGlobal
Dynamic VariableNo
Permitted Values Typefilename


The directory where character sets are installed. See Section聽9.2, 鈥淭he Character Set Used for Data and Sorting鈥?/a>.
--character-set-client-handshake
Command Line Format--character-set-client-handshake
Config File Formatcharacter-set-client-handshake
Permitted Values Typeboolean
DefaultTRUE


Don't ignore character set information sent by the client. To ignore client information and use the default server character set, use --skip-character-set-client-handshake; this makes MySQL behave like MySQL 4.0.
--character-set-filesystem=charset_name
Version Introduced5.0.19
Command Line Format--character-set-filesystem=name
Config File Formatcharacter-set-filesystem
Option Sets VariableYes, character_set_filesystem
Variable Namecharacter_set_filesystem
Variable ScopeBoth
Dynamic VariableYes
Permitted Values Typestring


The file system character set. This option sets the character_set_filesystem system variable. It was added in MySQL 5.0.19.
--character-set-server=charset_name, -C charset_name
Command Line Format--character-set-server
Config File Formatcharacter-set-server
Option Sets VariableYes, character_set_server
Variable Namecharacter_set_server
Variable ScopeBoth
Dynamic VariableYes
Permitted Values Typestring


Use charset_name as the default server character set. See Section聽9.2, 鈥淭he Character Set Used for Data and Sorting鈥?/a>. If you use this option to specify a nondefault character set, you should also use --collation-server to specify the collation.
--chroot=path, -r path
Command Line Format--chroot=name
Config File Formatchroot
Permitted Values Typefilename


Put the mysqld server in a closed environment during startup by using the chroot() system call. This is a recommended security measure. Note that use of this option somewhat limits LOAD DATA INFILE and SELECT ... INTO OUTFILE.
--collation-server=collation_name
Command Line Format--collation-server
Config File Formatcollation-server
Option Sets VariableYes, collation_server
Variable Namecollation_server
Variable ScopeBoth
Dynamic VariableYes
Permitted Values Typestring


Use collation_name as the default server collation. See Section聽9.2, 鈥淭he Character Set Used for Data and Sorting鈥?/a>.
--console
Command Line Format--console
Config File Formatconsole
Platform Specificwindows

(Windows only.) Write error log messages to stderr and stdout even if --log-error is specified. mysqld does not close the console window if this option is used.
--core-file
Command Line Format--core-file
Config File Formatcore-file
Permitted Values Typeboolean
DefaultTRUE


Write a core file if mysqld dies. The name and location of the core file is system dependent. On Linux, a core file named core.pid is written to the current working directory of the process, which for mysqld is the data directory. pid represents the process ID of the server process. On Mac OS X, a core file named core.pid is written to the /cores directory. On Solaris, use the coreadm command to specify where to write the core file and how to name it.
For some systems, to get a core file you must also specify the --core-file-size option to mysqld_safe. See Section聽4.3.2, 鈥?span>mysqld_safe 鈥?MySQL Server Startup Script鈥?/a>. On some systems, such as Solaris, you do not get a core file if you are also using the --user option. There might be additional restrictions or limitations. For example, it might be necessary to execute ulimit -c unlimited before starting the server. Consult your system documentation.
--datadir=path, -h path
Command Line Format--datadir=name
Config File Formatdatadir
Option Sets VariableYes, datadir
Variable Namedatadir
Variable ScopeGlobal
Dynamic VariableNo
Permitted Values Typefilename


The path to the data directory.
--debug[=debug_options], -# [debug_options]
Command Line Format--debug[=debug_options]
Config File Formatdebug
Variable Namedebug
Variable ScopeBoth
Dynamic VariableYes
Permitted Values Typestring
Default'd:t:o,/tmp/mysqld.trace


If MySQL is configured with --with-debug, you can use this option to get a trace file of what mysqld is doing. A typical debug_options string is 'd:t:o,file_name'. The default is 'd:t:i:o,mysqld.trace'. See MySQL Internals: Porting.
As of MySQL 5.0.25, using --with-debug to configure MySQL with debugging support enables you to use the --debug="d,parser_debug" option when you start the server. This causes the Bison parser that is used to process SQL statements to dump a parser trace to the server's standard error output. Typically, this output is written to the error log.
--default-character-set=charset_name (DEPRECATED)
Version Deprecated5.0
Command Line Format--default-character-set=name
Config File Formatdefault-character-set
Deprecated5.0
Permitted Values Typestring


Use charset_name as the default character set. This option is deprecated in favor of --character-set-server. See Section聽9.2, 鈥淭he Character Set Used for Data and Sorting鈥?/a>.
--default-collation=collation_name
Command Line Format--default-collation=name
Variable Namedefault-collation
Variable Scope聽
Dynamic VariableNo
Deprecated4.1.3
Permitted Values Typestring


Use collation_name as the default collation. This option is deprecated in favor of --collation-server. See Section聽9.2, 鈥淭he Character Set Used for Data and Sorting鈥?/a>.
--default-storage-engine=type
Command Line Format--default-storage-engine=name
Config File Formatdefault-storage-engine

Set the default storage engine (table type) for tables. See Chapter聽13, Storage Engines.
--default-table-type=type
Version Deprecated5.0
Command Line Format--default-table-type=name
Config File Formatdefault-table-type
Deprecated5.0, by default-storage-engine
Permitted Values Typestring


This option is a deprecated synonym for --default-storage-engine.
--default-time-zone=timezone
Command Line Format--default-time-zone=name
Config File Formatdefault-time-zone
Permitted Values Typestring


Set the default server time zone. This option sets the global time_zone system variable. If this option is not given, the default time zone is the same as the system time zone (given by the value of the system_time_zone system variable.
--delay-key-write[={OFF|ON|ALL}]
Command Line Format--delay-key-write[=name]
Config File Formatdelay-key-write
Option Sets VariableYes, delay_key_write
Variable Namedelay-key-write
Variable ScopeGlobal
Dynamic VariableYes
Permitted Values Typeenumeration
DefaultON
Valid ValuesON, OFF, ALL


Specify how to use delayed key writes. Delayed key writing causes key buffers not to be flushed between writes for MyISAM tables. OFF disables delayed key writes. ON enables delayed key writes for those tables that were created with the DELAY_KEY_WRITE option. ALL delays key writes for all MyISAM tables. See Section聽7.5.3, 鈥淭uning Server Parameters鈥?/a>, and Section聽13.1.1, 鈥?code class="literal">MyISAM Startup Options鈥?/a>.
Note
If you set this variable to ALL, you should not use MyISAM tables from within another program (such as another MySQL server or myisamchk) when the tables are in use. Doing so leads to index corruption.
--des-key-file=file_name
Command Line Format--des-key-file=name
Config File Formatdes-key-file

Read the default DES keys from this file. These keys are used by the DES_ENCRYPT() and DES_DECRYPT() functions.
--enable-named-pipe
Command Line Format--named_pipe
Config File Formatenable-named-pipe
Platform Specificwindows

Enable support for named pipes. This option can be used only with the mysqld-nt and mysqld-debug servers that support named-pipe connections.
--enable-pstack
Command Line Format--enable-pstack
Config File Formatenable-pstack
Permitted Values Typeboolean
DefaultFALSE


Print a symbolic stack trace on failure.
--engine-condition-pushdown={ON|OFF}
Version Introduced5.0.3
Command Line Format--engine-condition-pushdown
Config File Formatengine-condition-pushdown
Option Sets VariableYes, engine_condition_pushdown
Variable Nameengine_condition_pushdown
Variable ScopeBoth
Dynamic VariableYes
Permitted Values (>= 5.0.3)Typeboolean
DefaultOFF


Sets the engine_condition_pushdown system variable. For more information, see Section聽7.2.7, 鈥淐ondition Pushdown Optimization鈥?/a>.
This variable was added in MySQL 5.0.3.
--exit-info[=flags], -T [flags]
Command Line Format--exit-info[=flags]
Config File Formatexit-info
Permitted Values Typenumeric


This is a bit mask of different flags that you can use for debugging the mysqld server. Do not use this option unless you know exactly what it does!
--external-locking
Command Line Format--external-locking
Config File Formatexternal-locking
Option Sets VariableYes, skip_external_locking
Disabled byskip-external-locking
Permitted Values Typeboolean
DefaultFALSE


Enable external locking (system locking), which is disabled by default as of MySQL 4.0. Note that if you use this option on a system on which lockd does not fully work (such as Linux), it is easy for mysqld to deadlock. This option previously was named --enable-locking.
For more information about external locking, including conditions under which it can and cannot be used, see Section聽7.3.4, 鈥淓xternal Locking鈥?/a>.
--flush
Command Line Format--flush
Config File Formatflush
Variable Nameflush
Variable ScopeGlobal
Dynamic VariableYes
Permitted Values Typeboolean
DefaultOFF


Flush (synchronize) all changes to disk after each SQL statement. Normally, MySQL does a write of all changes to disk only after each SQL statement and lets the operating system handle the synchronizing to disk. See Section聽B.1.4.2, 鈥淲hat to Do If MySQL Keeps Crashing鈥?/a>.
--gdb
Command Line Format--gdb
Config File Formatgdb
Permitted Values Typeboolean
DefaultFALSE


Install an interrupt handler for SIGINT (needed to stop mysqld with ^C to set breakpoints) and disable stack tracing and core file handling. See MySQL Internals: Porting.
--init-file=file_name
Command Line Format--init-file=name
Config File Formatinit-file
Option Sets VariableYes, init_file
Variable Nameinit_file
Variable ScopeGlobal
Dynamic VariableNo
Permitted Values Typefilename


Read SQL statements from this file at startup. Each statement must be on a single line and should not include comments.
This option is unavailable if MySQL was configured with the --disable-grant-options option. See Section聽2.16.2, 鈥淭ypical configure Options鈥?/a>.
--innodb_safe_binlog
Version Removed5.0.3
Version Deprecated5.0.3
Command Line Format--innodb_safe_binlog
Config File Formatinnodb_safe_binlog
Deprecated5.0.3
Permitted Values Typeboolean


If this option is given, then after a crash recovery by InnoDB, mysqld truncates the binary log after the last not-rolled-back transaction in the log. The option also causes InnoDB to print an error if the binary log is smaller or shorter than it should be. See Section聽5.2.3, 鈥淭he Binary Log鈥?/a>. This option was removed in MySQL 5.0.3, having been made obsolete by the introduction of XA transaction support.
--innodb-xxx
The InnoDB options are listed in Section聽13.2.3, 鈥?code class="literal">InnoDB Startup Options and System Variables鈥?/a>.
--language=lang_name, -L lang_name
Command Line Format--language=name
Config File Formatlanguage
Option Sets VariableYes, language
Variable Namelanguage
Variable ScopeGlobal
Dynamic VariableNo
Deprecated5.4.4, by lc-messages-dir
Permitted Values Typefilename
Default/usr/local/mysql/share/mysql/english/


The language to use for error messages. lang_name can be given as the language name or as the full path name to the directory where the language files are installed. See Section聽9.3, 鈥淪etting the Error Message Language鈥?/a>.
--large-pages
Version Introduced5.0.3
Command Line Format--large-pages
Config File Formatlarge-pages
Option Sets VariableYes, large_pages
Variable Namelarge_pages
Variable ScopeGlobal
Dynamic VariableNo
Platform Specificlinux
Permitted Values Type (linux)boolean
DefaultFALSE


Some hardware/operating system architectures support memory pages greater than the default (usually 4KB). The actual implementation of this support depends on the underlying hardware and operating system. Applications that perform a lot of memory accesses may obtain performance improvements by using large pages due to reduced Translation Lookaside Buffer (TLB) misses.
Currently, MySQL supports only the Linux implementation of large page support (which is called HugeTLB in Linux). See Section聽7.5.9, 鈥淓nabling Large Page Support鈥?/a>.
--large-pages is disabled by default. It was added in MySQL 5.0.3.
--log[=file_name], -l [file_name]
Command Line Format--log[=name]
Config File Formatlog
Option Sets VariableYes, log
Variable Namelog
Variable ScopeGlobal
Dynamic VariableNo
Deprecated5.1.29, by general-log
Permitted Values Typestring
DefaultOFF


Log connections and SQL statements received from clients to this file. See Section聽5.2.2, 鈥淭he General Query Log鈥?/a>. If you omit the file name, MySQL uses host_name.log as the file name.
--log-error[=file_name]
Command Line Format--log-error[=name]
Config File Formatlog-error
Option Sets VariableYes, log_error
Variable Namelog_error
Variable ScopeGlobal
Dynamic VariableNo
Permitted Values Typefilename


Log errors and startup messages to this file. See Section聽5.2.1, 鈥淭he Error Log鈥?/a>. If you omit the file name, MySQL uses host_name.err. If the file name has no extension, the server adds an extension of .err.
--log-isam[=file_name]
Command Line Format--log-isam[=name]
Config File Formatlog-isam
Permitted Values Typefilename


Log all MyISAM changes to this file (used only when debugging MyISAM).
--log-long-format (DEPRECATED)
Command Line Format--log-long-format
Config File Formatlog-long-format
Deprecated4.1

Log extra information to the update log, binary update log, and slow query log, if they have been activated. For example, the user name and timestamp are logged for all queries. This option is deprecated, as it now represents the default logging behavior. (See the description for --log-short-format.) The --log-queries-not-using-indexes option is available for the purpose of logging queries that do not use indexes to the slow query log.
--log-queries-not-using-indexes
Command Line Format--log-queries-not-using-indexes
Config File Formatlog-queries-not-using-indexes
Option Sets VariableYes, log_queries_not_using_indexes
Variable Namelog_queries_not_using_indexes
Variable ScopeGlobal
Dynamic VariableYes
Deprecated5.1.29, by slow-query-log
Permitted Values Typeboolean


If you are using this option with the slow query log enabled, queries that are expected to retrieve all rows are logged. See Section聽5.2.4, 鈥淭he Slow Query Log鈥?/a>. This option does not necessarily mean that no index is used. For example, a query that uses a full index scan uses an index but would be logged because the index would not limit the number of rows.
--log-short-format
Command Line Format--log-short-format
Config File Formatlog-short-format
Permitted Values Typeboolean
DefaultFALSE


Originally intended to log less information to the update log, binary log and slow query log, if they have been activated. However, this option is not operational.
--log-slow-admin-statements
Command Line Format--log-slow-admin-statements
Config File Formatlog-slow-admin-statements
Permitted Values Typeboolean
DefaultFALSE


Log slow administrative statements such as OPTIMIZE TABLE, ANALYZE TABLE, and ALTER TABLE to the slow query log.
--log-slow-queries[=file_name]
Command Line Format--log-slow-queries[=name]
Config File Formatlog-slow-queries
Option Sets VariableYes, log_slow_queries
Variable Namelog_slow_queries
Variable ScopeGlobal
Dynamic VariableNo
Permitted Values Typeboolean


Log all queries that have taken more than long_query_time seconds to execute to this file. See Section聽5.2.4, 鈥淭he Slow Query Log鈥?/a>. See the descriptions of the --log-long-format and --log-short-format options for details.
--log-tc=file_name
Version Introduced5.0.3
Command Line Format--log-tc=name
Config File Formatlog-tc
Permitted Values Typefilename
Defaulttc.log


The name of the memory-mapped transaction coordinator log file (for XA transactions that affect multiple storage engines when the binary log is disabled). The default name is tc.log. The file is created under the data directory if not given as a full path name. Currently, this option is unused. Added in MySQL 5.0.3.
--log-tc-size=size
Version Introduced5.0.3
Command Line Format--log-tc-size=#
Config File Formatlog-tc-size
Permitted Values Platform Bit Size32
Typenumeric
Default24576
Max Value4294967295

Permitted Values Platform Bit Size64
Typenumeric
Default24576
Max Value18446744073709547520


The size in bytes of the memory-mapped transaction coordinator log. The default size is 24KB. Added in MySQL 5.0.3.
--log-warnings[=level], -W [level]
Command Line Format--log-warnings[=#]
Config File Formatlog-warnings
Option Sets VariableYes, log_warnings
Variable Namelog_warnings
Variable ScopeBoth
Dynamic VariableYes
Disabled byskip-log-warnings
Permitted Values Platform Bit Size32
Typenumeric
Default1
Range0-18446744073709547520


Print out warnings such as Aborted connection... to the error log. Enabling this option is recommended, for example, if you use replication (you get more information about what is happening, such as messages about network failures and reconnections). This option is enabled (1) by default, and the default level value if omitted is 1. To disable this option, use --log-warnings=0. If the value is greater than 1, aborted connections are written to the error log. See Section聽B.1.2.11, 鈥淐ommunication Errors and Aborted Connections鈥?/a>.
If a slave server was started with --log-warnings enabled, the slave prints messages to the error log to provide information about its status, such as the binary log and relay log coordinates where it starts its job, when it is switching to another relay log, when it reconnects after a disconnect, and so forth.
--low-priority-updates
Command Line Format--low-priority-updates
Config File Formatlow-priority-updates
Option Sets VariableYes, low_priority_updates
Variable Namelow_priority_updates
Variable ScopeBoth
Dynamic VariableYes
Permitted Values Typeboolean
DefaultFALSE


Give table-modifying operations (INSERT, REPLACE, DELETE, UPDATE) lower priority than selects. This can also be done via {INSERT | REPLACE | DELETE | UPDATE} LOW_PRIORITY ... to lower the priority of only one query, or by SET LOW_PRIORITY_UPDATES=1 to change the priority in one thread. This affects only storage engines that use only table-level locking (MyISAM, MEMORY, MERGE). See Section聽7.3.2, 鈥淭able Locking Issues鈥?/a>.
--memlock
Command Line Format--memlock
Config File Formatmemlock
Variable Namelocked_in_memory
Variable ScopeGlobal
Dynamic VariableNo
Permitted Values Typeboolean
DefaultFALSE


Lock the mysqld process in memory. This option might help if you have a problem where the operating system is causing mysqld to swap to disk.
--memlock works on systems that support the mlockall() system call; this includes Solaris as well as most Linux distributions that use a 2.4 or newer kernel. On Linux systems, you can tell whether or not mlockall() (and thus this option) is supported by checking to see whether or not it is defined in the system mman.h file, like this:
shell> grep mlockall /usr/include/sys/mman.h

If mlockall() is supported, you should see in the output of the previous command something like the following:
extern int mlockall (int __flags) __THROW;

Important
Using this option requires that you run the server as root, which, for reasons of security, is normally not a good idea. See Section聽5.3.5, 鈥淗ow to Run MySQL as a Normal User鈥?/a>.
You must not try to use this option on a system that does not support the mlockall() system call; if you do so, mysqld will very likely crash as soon as you try to start it.
--myisam-block-size=N
Command Line Format--myisam-block-size=#
Config File Formatmyisam-block-size
Permitted Values Typenumeric
Default1024
Range1024-16384


The block size to be used for MyISAM index pages.
--myisam-recover[=option[,option]...]]
Command Line Format--myisam-recover[=name]
Config File Formatmyisam-recover
Permitted Values Typeenumeration
DefaultOFF
Valid ValuesDEFAULT, BACKUP, FORCE, QUICK


Set the MyISAM storage engine recovery mode. The option value is any combination of the values of DEFAULT, BACKUP, FORCE, or QUICK. If you specify multiple values, separate them by commas. Specifying the option with no argument is the same as specifying DEFAULT, and specifying with an explicit value of "" disables recovery (same as not giving the option). If recovery is enabled, each time mysqld opens a MyISAM table, it checks whether the table is marked as crashed or wasn't closed properly. (The last option works only if you are running with external locking disabled.) If this is the case, mysqld runs a check on the table. If the table was corrupted, mysqld attempts to repair it.
The following options affect how the repair works.
OptionDescription
DEFAULTRecovery without backup, forcing, or quick checking.
BACKUPIf the data file was changed during recovery, save a backup of the tbl_name.MYD file as tbl_name-datetime.BAK.
FORCERun recovery even if we would lose more than one row from the .MYD file.
QUICKDon't check the rows in the table if there aren't any delete blocks.

Before the server automatically repairs a table, it writes a note about the repair to the error log. If you want to be able to recover from most problems without user intervention, you should use the options BACKUP,FORCE. This forces a repair of a table even if some rows would be deleted, but it keeps the old data file as a backup so that you can later examine what happened.
See Section聽13.1.1, 鈥?code class="literal">MyISAM Startup Options鈥?/a>.
--old-passwords
Command Line Format--old_passwords
Config File Formatold-passwords
Option Sets VariableYes, old_passwords
Variable Nameold_passwords
Variable ScopeBoth
Dynamic VariableYes
Permitted Values Typeboolean
DefaultFALSE


Force the server to generate short (pre-4.1) password hashes for new passwords. This is useful for compatibility when the server must support older client programs. See Section聽5.5.6.3, 鈥淧assword Hashing in MySQL鈥?/a>.
--old-style-user-limits
Version Introduced5.0.3
Command Line Format--old-style-user-limits
Config File Formatold-style-user-limits
Permitted Values Typeboolean
DefaultFALSE


Enable old-style user limits. (Before MySQL 5.0.3, account resource limits were counted separately for each host from which a user connected rather than per account row in the user table.) See Section聽5.5.4, 鈥淟imiting Account Resources鈥?/a>. This option was added in MySQL 5.0.3.
--one-thread
Command Line Format--one-thread
Config File Formatone-thread

Only use one thread (for debugging under Linux). This option is available only if the server is built with debugging enabled. See MySQL Internals: Porting.
--open-files-limit=count
Command Line Format--open-files-limit=#
Config File Formatopen-files-limit
Option Sets VariableYes, open_files_limit
Variable Nameopen_files_limit
Variable ScopeGlobal
Dynamic VariableNo
Permitted Values Typenumeric
Default0
Range0-65535


Changes the number of file descriptors available to mysqld. You should try increasing the value of this option if mysqld gives you the error Too many open files. mysqld uses the option value to reserve descriptors with setrlimit(). If the requested number of file descriptors cannot be allocated, mysqld writes a warning to the error log.
mysqld may attempt to allocate more than the requested number of descriptors (if they are available), using the values of max_connections and table_cache to estimate whether more descriptors will be needed.
--pid-file=path
Command Line Format--pid-file=name
Config File Formatpid-file
Option Sets VariableYes, pid_file
Variable Namepid_file
Variable ScopeGlobal
Dynamic VariableNo
Permitted Values Typefilename


The path name of the process ID file. This file is used by other programs such as mysqld_safe to determine the server's process ID.
--port=port_num, -P port_num
Command Line Format--port=#
Config File Formatport
Option Sets VariableYes, port
Variable Nameport
Variable ScopeGlobal
Dynamic VariableNo
Permitted Values Typenumeric
Default3306


The port number to use when listening for TCP/IP connections. The port number must be 1024 or higher unless the server is started by the root system user.
--port-open-timeout=num
Version Introduced5.0.19
Command Line Format--port-open-timeout=#
Config File Formatport-open-timeout
Permitted Values Typenumeric
Default0


On some systems, when the server is stopped, the TCP/IP port might not become available immediately. If the server is restarted quickly afterward, its attempt to reopen the port can fail. This option indicates how many seconds the server should wait for the TCP/IP port to become free if it cannot be opened. The default is not to wait. This option was added in MySQL 5.0.19.
--safe-mode
Version Deprecated5.0
Command Line Format--safe-mode
Config File Formatsafe-mode
Deprecated5.0

Skip some optimization stages.
--safe-show-database (DEPRECATED)
Command Line Format--safe-show-database
Config File Formatsafe-show-database
Variable Namesafe_show_database
Variable ScopeGlobal
Dynamic VariableYes
Deprecated4.0.2
Permitted Values Typeboolean


See Section聽5.4.1, 鈥淧rivileges Provided by MySQL鈥?/a>.
--safe-user-create
Command Line Format--safe-user-create
Config File Formatsafe-user-create
Permitted Values Typeboolean
DefaultFALSE


If this option is enabled, a user cannot create new MySQL users by using the GRANT statement unless the user has the INSERT privilege for the mysql.user table or any column in the table. If you want a user to have the ability to create new users that have those privileges that the user has the right to grant, you should grant the user the following privilege:
GRANT INSERT(user) ON mysql.user TO 'user_name'@'host_name';

This ensures that the user cannot change any privilege columns directly, but has to use the GRANT statement to give privileges to other users.
--secure-auth
Command Line Format--secure-auth
Config File Formatsecure-auth
Option Sets VariableYes, secure_auth
Variable Namesecure_auth
Variable ScopeGlobal
Dynamic VariableYes
Permitted Values Typeboolean
DefaultFALSE


Disallow authentication by clients that attempt to use accounts that have old (pre-4.1) passwords.
--secure-file-priv=path
Version Introduced5.0.38
Command Line Format--secure-file-priv
Config File Formatsecure-file-priv
Option Sets VariableYes, secure_file_priv
Variable Namesecure_file_priv
Variable ScopeGlobal
Dynamic VariableNo
Permitted Values Typestring


This option limits the effect of the LOAD_FILE() function and the LOAD DATA and SELECT ... INTO OUTFILE statements to work only with files in the specified directory.
This option was added in MySQL 5.0.38.
--shared-memory
Enable shared-memory connections by local clients. This option is available only on Windows.
--shared-memory-base-name=name
The name of shared memory to use for shared-memory connections. This option is available only on Windows. The default name is MYSQL. The name is case sensitive.
--skip-bdb
Disable the BDB storage engine. This saves memory and might speed up some operations. Do not use this option if you require BDB tables.
--skip-concurrent-insert
Turn off the ability to select and insert at the same time on MyISAM tables. (This is to be used only if you think you have found a bug in this feature.) See Section聽7.3.3, 鈥淐oncurrent Inserts鈥?/a>.
--skip-external-locking
Do not use external locking (system locking). For more information about external locking, including conditions under which it can and cannot be used, see Section聽7.3.4, 鈥淓xternal Locking鈥?/a>.
External locking has been disabled by default since MySQL 4.0.
--skip-grant-tables
This option causes the server to start without using the privilege system at all, which gives anyone with access to the server unrestricted access to all databases. You can cause a running server to start using the grant tables again by executing mysqladmin flush-privileges or mysqladmin reload command from a system shell, or by issuing a MySQL FLUSH PRIVILEGES statement after connecting to the server. This option also suppresses loading of user-defined functions (UDFs).
This option is unavailable if MySQL was configured with the --disable-grant-options option. See Section聽2.16.2, 鈥淭ypical configure Options鈥?/a>.
--skip-host-cache
Do not use the internal host name cache for faster name-to-IP resolution. Instead, query the DNS server every time a client connects. See Section聽7.5.11, 鈥淗ow MySQL Uses DNS鈥?/a>.
--skip-innodb
Disable the InnoDB storage engine. This saves memory and disk space and might speed up some operations. Do not use this option if you require InnoDB tables.
--skip-merge
Disable the MERGE storage engine. This option was added in MySQL 5.0.24. It can be used if the following behavior is undesirable: If a user has access to MyISAM table t, that user can create a MERGE table m that accesses t. However, if the user's privileges on t are subsequently revoked, the user can continue to access t by doing so through m.
--skip-name-resolve
Do not resolve host names when checking client connections. Use only IP numbers. If you use this option, all Host column values in the grant tables must be IP numbers or localhost. See Section聽7.5.11, 鈥淗ow MySQL Uses DNS鈥?/a>.
--skip-networking
Don't listen for TCP/IP connections at all. All interaction with mysqld must be made via named pipes or shared memory (on Windows) or Unix socket files (on Unix). This option is highly recommended for systems where only local clients are allowed. See Section聽7.5.11, 鈥淗ow MySQL Uses DNS鈥?/a>.
--ssl*
Options that begin with --ssl specify whether to allow clients to connect via SSL and indicate where to find SSL keys and certificates. See Section聽5.5.7.3, 鈥淪SL Command Options鈥?/a>.
--standalone
Command Line Format--standalone
Config File Formatstandalone
Platform Specificwindows

Instructs the MySQL server not to run as a service.
--symbolic-links, --skip-symbolic-links
Command Line Format--symbolic-links
Config File Formatsymbolic-links

Enable or disable symbolic link support. This option has different effects on Windows and Unix:
On Windows, enabling symbolic links allows you to establish a symbolic link to a database directory by creating a db_name.sym file that contains the path to the real directory. See Section聽7.6.1.3, 鈥淯sing Symbolic Links for Databases on Windows鈥?/a>.
On Unix, enabling symbolic links means that you can link a MyISAM index file or data file to another directory with the INDEX DIRECTORY or DATA DIRECTORY options of the CREATE TABLE statement. If you delete or rename the table, the files that its symbolic links point to also are deleted or renamed. See Section聽7.6.1.2, 鈥淯sing Symbolic Links for Tables on Unix鈥?/a>.
--skip-safemalloc
Command Line Format--skip-safe-malloc
Config File Formatskip-safemalloc

If MySQL is configured with --with-debug=full, all MySQL programs check for memory overruns during each memory allocation and memory freeing operation. This checking is very slow, so for the server you can avoid it when you don't need it by using the --skip-safemalloc option.
--skip-show-database
Command Line Format--skip-show-database
Config File Formatskip-show-database
Option Sets VariableYes, skip_show_database
Variable Nameskip_show_database
Variable ScopeGlobal
Dynamic VariableNo

With this option, the SHOW DATABASES statement is allowed only to users who have the SHOW DATABASES privilege, and the statement displays all database names. Without this option, SHOW DATABASES is allowed to all users, but displays each database name only if the user has the SHOW DATABASES privilege or some privilege for the database. Note that any global privilege is considered a privilege for the database.
--skip-stack-trace
Command Line Format--skip-stack-trace
Config File Formatskip-stack-trace

Don't write stack traces. This option is useful when you are running mysqld under a debugger. On some systems, you also must use this option to get a core file. See MySQL Internals: Porting.
--skip-thread-priority
Command Line Format--skip-thread-priority
Config File Formatskip-thread-priority
Deprecated5.1.29

Disable using thread priorities for faster response time.
--socket=path
Command Line Format--socket=name
Config File Formatsocket
Option Sets VariableYes, socket
Variable Namesocket
Variable ScopeGlobal
Dynamic VariableNo
Permitted Values Typefilename
Default/tmp/mysql.sock


On Unix, this option specifies the Unix socket file to use when listening for local connections. The default value is /tmp/mysql.sock. On Windows, the option specifies the pipe name to use when listening for local connections that use a named pipe. The default value is MySQL (not case sensitive).
--sql-mode=value[,value[,value...]]
Command Line Format--sql-mode=name
Config File Formatsql-mode
Option Sets VariableYes, sql_mode
Variable Namesql_mode
Variable ScopeBoth
Dynamic VariableYes
Permitted Values Typeset
Default''
Valid ValuesALLOW_INVALID_DATES, ANSI_QUOTES, ERROR_FOR_DIVISION_BY_ZERO, HIGH_NOT_PRECEDENCE, IGNORE_SPACE, NO_AUTO_CREATE_USER, NO_AUTO_VALUE_ON_ZERO, NO_BACKSLASH_ESCAPES, NO_DIR_IN_CREATE, NO_ENGINE_SUBSTITUTION, NO_FIELD_OPTIONS, NO_KEY_OPTIONS, NO_TABLE_OPTIONS, NO_UNSIGNED_SUBTRACTION, NO_ZERO_DATE, NO_ZERO_IN_DATE, ONLY_FULL_GROUP_BY, PAD_CHAR_TO_FULL_LENGTH, PIPES_AS_CONCAT, REAL_AS_FLOAT, STRICT_ALL_TABLES, STRICT_TRANS_TABLES


Set the SQL mode. See Section聽5.1.7, 鈥淪erver SQL Modes鈥?/a>.
--sysdate-is-now
Version Introduced5.0.20
Command Line Format--sysdate-is-now
Config File Formatsysdate-is-now
Permitted Values Typeboolean
DefaultFALSE


As of MySQL 5.0.12, SYSDATE() by default returns the time at which it executes, not the time at which the statement in which it occurs begins executing. This differs from the behavior of NOW(). This option causes SYSDATE() to be an alias for NOW(). For information about the implications for binary logging and replication, see the description for SYSDATE() in Section聽11.6, 鈥淒ate and Time Functions鈥?/a> and for SET TIMESTAMP in Section聽5.1.4, 鈥淪ession System Variables鈥?/a>.
This option was added in MySQL 5.0.20.
--tc-heuristic-recover={COMMIT|ROLLBACK}
Version Introduced5.0.3
Command Line Format--tc-heuristic-recover=name
Config File Formattc-heuristic-recover
Permitted Values Typeenumeration
Valid ValuesCOMMIT, RECOVER


The type of decision to use in the heuristic recovery process. Currently, this option is unused. Added in MySQL 5.0.3.
--temp-pool
Command Line Format--temp-pool
Config File Formattemp-pool
Permitted Values Typeboolean
DefaultTRUE


This option causes most temporary files created by the server to use a small set of names, rather than a unique name for each new file. This works around a problem in the Linux kernel dealing with creating many new files with different names. With the old behavior, Linux seems to 鈥?span class="quote">leak鈥? memory, because it is being allocated to the directory entry cache rather than to the disk cache.
--transaction-isolation=level
Command Line Format--transaction-isolation=name
Config File Formattransaction-isolation
Permitted Values Typeenumeration
Valid ValuesREAD-UNCOMMITTED, READ-COMMITTED, REPEATABLE-READ, SERIALIZABLE


Sets the default transaction isolation level. The level value can be READ-UNCOMMITTED, READ-COMMITTED, REPEATABLE-READ, or SERIALIZABLE. See Section聽12.4.6, 鈥?code class="literal">SET TRANSACTION Syntax鈥?/a>.
--tmpdir=path, -t path
Command Line Format--tmpdir=name
Config File Formattmpdir
Option Sets VariableYes, tmpdir
Variable Nametmpdir
Variable ScopeGlobal
Dynamic VariableNo
Permitted Values Typefilename


The path of the directory to use for creating temporary files. It might be useful if your default /tmp directory resides on a partition that is too small to hold temporary tables. This option accepts several paths that are used in round-robin fashion. Paths should be separated by colon characters (鈥?span class="quote">:鈥? on Unix and semicolon characters (鈥?span class="quote">;鈥? on Windows, NetWare, and OS/2. If the MySQL server is acting as a replication slave, you should not set --tmpdir to point to a directory on a memory-based file system or to a directory that is cleared when the server host restarts. For more information about the storage location of temporary files, see Section聽B.1.4.4, 鈥淲here MySQL Stores Temporary Files鈥?/a>. A replication slave needs some of its temporary files to survive a machine restart so that it can replicate temporary tables or LOAD DATA INFILE operations. If files in the temporary file directory are lost when the server restarts, replication fails.
--user={user_name|user_id}, -u {user_name|user_id}
Command Line Format--user=name
Config File Formatuser
Permitted Values Typestring


Run the mysqld server as the user having the name user_name or the numeric user ID user_id. (鈥?span class="quote">User鈥?in this context refers to a system login account, not a MySQL user listed in the grant tables.)
This option is mandatory when starting mysqld as root. The server changes its user ID during its startup sequence, causing it to run as that particular user rather than as root. See Section聽5.3.1, 鈥淕eneral Security Guidelines鈥?/a>.
To avoid a possible security hole where a user adds a --user=root option to a my.cnf file (thus causing the server to run as root), mysqld uses only the first --user option specified and produces a warning if there are multiple --user options. Options in /etc/my.cnf and $MYSQL_HOME/my.cnf are processed before command-line options, so it is recommended that you put a --user option in /etc/my.cnf and specify a value other than root. The option in /etc/my.cnf is found before any other --user options, which ensures that the server runs as a user other than root, and that a warning results if any other --user option is found.
--verbose, -v
Use this option with the --help option for detailed help.
--version, -V
Command Line Format--version
Config File Formatversion
Variable Nameversion
Variable ScopeGlobal
Dynamic VariableNo

Display version information and exit.
You can assign a value to a server system variable by using an option of the form --var_name=value. For example, --key_buffer_size=32M sets the key_buffer_size variable to a value of 32MB.
Note that when you assign a value to a variable, MySQL might automatically correct the value to stay within a given range, or adjust the value to the closest allowable value if only certain values are allowed.
If you want to restrict the maximum value to which a variable can be set at runtime with SET, you can define this by using the --maximum-var_name=value command-line option.
It is also possible to set variables by using --set-variable=var_name=value or -O var_name=value syntax. This syntax is deprecated.
You can change the values of most system variables for a running server with the SET statement. See Section聽12.5.4, 鈥?code class="literal">SET Syntax鈥?/a>.
Section聽5.1.3, 鈥淪erver System Variables鈥?/a>, provides a full description for all variables, and additional information for setting them at server startup and runtime. Section聽7.5.3, 鈥淭uning Server Parameters鈥?/a>, includes information on optimizing the server by tuning system variables.
Previous / Next / Up / Table of Contents


User Comments
Posted by Dathan Pattishall on June 8 2004 3:57pm[Delete] [Edit]

open_files_limit: If your mysql server process runs as mysql then the setrlimit will not raise higher then the calling safe_mysqld process. Thus relying on max_connections*5 does not work for a Linux ulimit. Use open_files_limit to go beyond 1024.

Posted by Chris Foote on September 25 2006 5:59am[Delete] [Edit]

To get the server listening on all interfaces, use 0.0.0.0 as the bind address. i.e.:

--bind-address=0.0.0.0


Add your own comment.
Top / Previous / Next / Up / Table of Contents
? 1995-2008 MySQL AB, 2008-2009 Sun Microsystems, Inc.
Online Shop
Site Map
About MySQL
Legal
Privacy Policy
Contact Us
Job Opportunities
您需要登录后才可以回帖 登录 | 注册

本版积分规则

QQ|小黑屋|最新主题|手机版|微赢网络技术论坛 ( 苏ICP备08020429号 )

GMT+8, 2024-10-1 03:31 , Processed in 0.214577 second(s), 12 queries , Gzip On, MemCache On.

Powered by Discuz! X3.5

© 2001-2023 Discuz! Team.

快速回复 返回顶部 返回列表