Chinaunix首页 | 论坛 | 博客
  • 博客访问: 19882180
  • 博文数量: 679
  • 博客积分: 10495
  • 博客等级: 上将
  • 技术积分: 9308
  • 用 户 组: 普通用户
  • 注册时间: 2006-07-18 10:51
文章分类

全部博文(679)

文章存档

2012年(5)

2011年(38)

2010年(86)

2009年(145)

2008年(170)

2007年(165)

2006年(89)

分类: Mysql/postgreSQL

2008-02-25 10:34:28

配置MYSQL

本章接第一章

       许多MYSQL程序有配置选项,也可以通过文件来配置.全局配置在/etc/my.cnf设置.另外还有一些可选的默认配置在/usr/local/mysql/support-files

配置MYSQL选项

程序的参数可以在命令行输入,也可以放在配置文件.这些程序有: 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

29202 pts/1    S+     0:00          \_ 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

 

§12.2, 小结

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.

阅读(7437) | 评论(1) | 转发(0) |
给主人留下些什么吧!~~

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