下面的配置文件说明不一定准确,有些需待验证
#下面的配置文件只对client端生效,虽然是同一个配置文件,但是是分字段的,每个字段只对对应的应用生效
[client]
#经过测试,如果本机运行了mysqld服务,设置root连接要输入密码,在这里设置了root的连接密码,可以免密码连接到mysqld服务上面,没有测试过其他的情况,有机会测试,注意权限,保证密码安全
#password = your_password
#mysql客户端连接到mysqld服务的时候,指明要连接的服务端mysql服务的监听端口
port = 3306
#通过文件系统(而非网络地址)进行寻址和访问的套接字,客户端和服务端指定同一位置的套接字进行通信,两个配置文件要设置为相同的位置。不通过网络,速度快。
socket = /usr/local/mysql/mysql.sock
#下面的配置文件只对mysqld服务生效
[mysqld]
#运行mysqld服务的用户
user = mysql
#存放数据库文件的目录
datadir = /mysql
#mysqld服务监听的端口
port = 3306
#设置与客户端(只有本地的客户端才能通过sock文件通信)通信的sock文件位置
socket = /usr/local/mysql/mysql.sock
[client] #password = your_password port = 3306 socket = /usr/local/mysql/mysql.sock [mysqld] user = mysql datadir = /mysql bind-address=0.0.0.0 #监听全部地址或者指定的ip地址 port = 3306 socket = /usr/local/mysql/mysql.sock key_buffer_size = 256M max_allowed_packet = 1M table_open_cache = 256 sort_buffer_size = 1M read_buffer_size = 1M read_rnd_buffer_size = 4M myisam_sort_buffer_size = 64M thread_cache_size = 8 query_cache_size= 16M # Try number of CPU's*2 for thread_concurrency thread_concurrency = 8 # Replication Master Server (default) # binary logging is required for replication log-bin=mysql-bin # binary logging format - mixed recommended binlog_format=mixed # required unique id between 1 and 2^32 - 1 # defaults to 1 if master-host is not set # but will not function as a master if omitted server-id = 1 # Uncomment the following if you are using InnoDB tables innodb_data_home_dir = /mysql innodb_data_file_path = ibdata1:10M:autoextend innodb_log_group_home_dir = /mysql # You can set .._buffer_pool_size up to 50 - 80 % # of RAM but beware of setting memory usage too high innodb_buffer_pool_size = 256M innodb_additional_mem_pool_size = 20M # Set .._log_file_size to 25 % of buffer pool size innodb_log_file_size = 64M innodb_log_buffer_size = 8M innodb_flush_log_at_trx_commit = 1 innodb_lock_wait_timeout = 50 [mysqldump] quick max_allowed_packet = 16M [mysql] no-auto-rehash # Remove the next comment character if you are not familiar with SQL #safe-updates [myisamchk] key_buffer_size = 128M sort_buffer_size = 128M read_buffer = 2M write_buffer = 2M [mysqlhotcopy] interactive-timeout [mysqld_safe] log-error=/var/log/mysqld.log pid-file=/usr/local/mysql/mysqld.pid
http://www.blogjava.net/hunter129/archive/2009/01/18/251744.html
http://database.51cto.com/art/201108/285365.htm
http://blog.sina.com.cn/s/blog_69c042950100jeck.html
评论前必须登录!
注册