分类: Mysql/postgreSQL
2008-02-25 10:34:28
本章接第一章
许多MYSQL程序有配置选项,也可以通过文件来配置.全局配置在/etc/my.cnf设置.另外还有一些可选的默认配置在/usr/local/mysql/support-files
程序的参数可以在命令行输入,也可以放在配置文件.这些程序有: mysql, mysqladmin, mysqld, mysqld_safe, mysql.server, mysqldump, mysqlimport, mysqlshow, mysqlcheck, myisamchk, and myisampack
在linux中, /etc/my.cnf配置全局的选项,用户目录下的.my.cnf配置自己的服务.
查看帮助:
./mysqld --verbose --help |less
比如一个实例:
[root@LS-SVR-17
bin]# ps afx | grep mysql
31703 ? S
0:00 /bin/sh ./bin/mysqld_safe --datadir=/usr/local/mysql_data
--pid-file=/usr/local/mysql_data/LS-SVR-17.pid
31765 ? Sl
0:04 \_
/usr/local/mysql/bin/mysqld --basedir=/usr/local/mysql
--datadir=/usr/local/mysql_data --user=mysql
--pid-file=/usr/local/mysql_data/LS-SVR-17.pid
--log-error=/usr/local/mysql_data/LS-SVR-17.err --socket=/tmp/mysql.sock
--port=3306
InnoDB 的配置选项和多安装配置以及国际化配置参见教材
查看帮助:mysqld
–help
The MySQL
programs mysql, mysqladmin, mysqld, mysqld_safe, mysql.server, mysqldump,
mysqlimport, mysqlshow, mysqlcheck, myisamchk, and myisampack all support the
use of a common options file.
You can set
options on a global basis, on a server basis, on a user-by-user basis, or all
by of these.
The syntax of
the file begins with the name of the program in square brackets, followed by
options for that program. Comments start with #. Each option may be expressed
as option, option=value, or set-variable option=value.
You can obtain
a complete list of options to mysqld with mysqld --help.
You can run
multiple MySQL servers on the same physical machine as long as options are set
to avoid clashes. You must set up different ports, sockets, and log files for
each server.
You can use
the options file to set the default character set and collation for the server.
The character set is the set of symbols used. The collation is the sort order.
chinaunix网友2008-02-25 10:34:52
§12.3, 习题和答案 1: The option --no-defaults to mysqld means don't use any default values; use only values from the options file don't read any options files read only the global options files none of the above 2: The InnoDB option used to set the tablespace filesize is innodb_buffer_pool_size innodb_data_file_path innodb_log_buffer_size none of the above 3: The InnoDB option used to set the size of the table data buffer is innodb_buffer_pool_size innodb_data_f