Chinaunix

标题: MYSQL 教程:§12, 配置MYSQL [打印本页]

作者: oychw    时间: 2008-02-25 10:34
标题: MYSQL 教程:§12, 配置MYSQL

§12, 配置MYSQL
本章接第一章
       许多MYSQL程序有配置选项,也可以通过文件来配置.全局配置在/etc/my.cnf设置.另外还有一些可选的默认配置在/usr/local/mysql/support-files
§12.1, 配置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.
               
               
               

本文来自ChinaUnix博客,如果查看原文请点:http://blog.chinaunix.net/u/21908/showart_483128.html




欢迎光临 Chinaunix (http://bbs.chinaunix.net/) Powered by Discuz! X3.2