Discuz!官方免费开源建站系统

 找回密码
 立即注册

QQ登录

只需一步,快速开始

搜索

有关mysql的my.cnf文件优化

[复制链接]
杜皮厚厚 发表于 2007-1-28 10:41:29 | 显示全部楼层 |阅读模式
附件是我的 mycnf文件,但重启mysql的时候启动正常,但出现连续3行的提示错误,请看一下。谢谢

chown :cannot access /etc/lib/myslq/r . no such file or directory

麻烦给看看。那里的问题。

我给大部分的东西都给注释了,但还是有问题。


[mysqld]
set-variable=max_connections=500
datadir=/var/lib/mysql
socket=/var/lib/mysql/mysql.sock

skip-networking
skip-innodb
skip-bdb
wait_timeout = 5
skip-locking
key_buffer = 384M
max_allowed_packet = 1M
table_cache = 512
sort_buffer_size = 2M
read_buffer_size = 2M
read_rnd_buffer_size = 8M
myisam_sort_buffer_size = 64M
thread_cache_size = 8
query_cache_size = 32M
# Try number of CPU's*2 for thread_concurrency
thread_concurrency = 2

# Default to using old password format for compatibility with mysql 3.x
# clients (those using the mysqlclient10 compatibility package).
old_passwords=1
     
[mysql.server]
user=mysql
basedir=/var/lib

[mysqld_safe]
err-log=/var/log/mysqld.log
pid-file=/var/run/mysqld/mysqld.pid

# [mysql]
# no-auto-rehash
# Remove the next comment character if you are not familiar with SQL
#safe-updates

# [isamchk]
# key_buffer = 256M
# sort_buffer_size = 256M
# read_buffer = 2M
# write_buffer = 2M

# [myisamchk]
# key_buffer = 256M
# sort_buffer_size = 256M
# read_buffer = 2M
# write_buffer = 2M

# [mysqlhotcopy]
# interactive-timeout
hao32 发表于 2007-1-28 17:25:11 | 显示全部楼层
能说的再清楚点吗?哪三行错误啊...???
回复

使用道具 举报

 楼主| 杜皮厚厚 发表于 2007-1-28 18:54:29 | 显示全部楼层
提示信息就是这样。我也不知道怎么描述。
回复

使用道具 举报

wildcat707 发表于 2007-1-29 10:15:32 | 显示全部楼层
chown :cannot access /etc/lib/myslq/r . no such file or directory
看一下权限吧。
回复

使用道具 举报

enhand 发表于 2008-9-13 12:20:05 | 显示全部楼层

用我的吧!

  1. # Example MySQL config file for large systems.
  2. #
  3. # This is for a large system with memory = 512M where the system runs mainly
  4. # MySQL.
  5. #
  6. # You can copy this file to
  7. # /etc/my.cnf to set global options,
  8. # mysql-data-dir/my.cnf to set server-specific options (in this
  9. # installation this directory is /var/db/mysql) or
  10. # ~/.my.cnf to set user-specific options.
  11. #
  12. # In this file, you can use all long options that a program supports.
  13. # If you want to know which options a program supports, run the program
  14. # with the "--help" option.

  15. # The following options will be passed to all MySQL clients

  16. [client]
  17. #password        = your_password
  18. port                = 3306
  19. socket                = /tmp/mysql.sock

  20. # Here follows entries for some specific programs

  21. # The MySQL server
  22. [mysqld]
  23. port                = 3306
  24. socket                = /tmp/mysql.sock
  25. skip-locking
  26. skip-innodb
  27. skip-bdb
  28. key_buffer = 512M
  29. max_allowed_packet = 1M
  30. table_cache = 512
  31. sort_buffer_size = 2M
  32. read_buffer_size = 2M
  33. read_rnd_buffer_size = 4M
  34. myisam_sort_buffer_size = 64M
  35. thread_cache_size = 8
  36. query_cache_size= 32M
  37. wait_timeout = 5
  38. skip-networking
  39. max_connections=900

  40. # Try number of CPU's*2 for thread_concurrency
  41. thread_concurrency = 8

  42. # Don't listen on a TCP/IP port at all. This can be a security enhancement,
  43. # if all processes that need to connect to mysqld run on the same host.
  44. # All interaction with mysqld must be made via Unix sockets or named pipes.
  45. # Note that using this option without enabling named pipes on Windows
  46. # (via the "enable-named-pipe" option) will render mysqld useless!
  47. #
  48. #skip-networking

  49. # Replication Master Server (default)
  50. # binary logging is required for replication
  51. #log-bin

  52. # required unique id between 1 and 2^32 - 1
  53. # defaults to 1 if master-host is not set
  54. # but will not function as a master if omitted

  55. server-id        = 1

  56. # Replication Slave (comment out master section to use this)
  57. #
  58. # To configure this host as a replication slave, you can choose between
  59. # two methods :
  60. #
  61. # 1) Use the CHANGE MASTER TO command (fully described in our manual) -
  62. #    the syntax is:
  63. #
  64. #    CHANGE MASTER TO MASTER_HOST=<host>, MASTER_PORT=<port>,
  65. #    MASTER_USER=<user>, MASTER_PASSWORD=<password> ;
  66. #
  67. #    where you replace <host>, <user>, <password> by quoted strings and
  68. #    <port> by the master's port number (3306 by default).
  69. #
  70. #    Example:
  71. #
  72. #    CHANGE MASTER TO MASTER_HOST='125.564.12.1', MASTER_PORT=3306,
  73. #    MASTER_USER='joe', MASTER_PASSWORD='secret';
  74. #
  75. # OR
  76. #
  77. # 2) Set the variables below. However, in case you choose this method, then
  78. #    start replication for the first time (even unsuccessfully, for example
  79. #    if you mistyped the password in master-password and the slave fails to
  80. #    connect), the slave will create a master.info file, and any later
  81. #    change in this file to the variables' values below will be ignored and
  82. #    overridden by the content of the master.info file, unless you shutdown
  83. #    the slave server, delete master.info and restart the slaver server.
  84. #    For that reason, you may want to leave the lines below untouched
  85. #    (commented) and instead use CHANGE MASTER TO (see above)
  86. #
  87. # required unique id between 2 and 2^32 - 1
  88. # (and different from the master)
  89. # defaults to 2 if master-host is set
  90. # but will not function as a slave if omitted
  91. #server-id       = 2
  92. #
  93. # The replication master for this slave - required
  94. #master-host     =   <hostname>
  95. #
  96. # The username the slave will use for authentication when connecting
  97. # to the master - required
  98. #master-user     =   <username>
  99. #
  100. # The password the slave will authenticate with when connecting to
  101. # the master - required
  102. #master-password =   <password>
  103. #
  104. # The port the master is listening on.
  105. # optional - defaults to 3306
  106. #master-port     =  <port>
  107. #
  108. # binary logging - not required for slaves, but recommended
  109. #log-bin

  110. # Point the following paths to different dedicated disks
  111. tmpdir                = /tmp/               
  112. #log-update         = /path-to-dedicated-directory/hostname

  113. # Uncomment the following if you are using BDB tables
  114. #bdb_cache_size = 64M
  115. #bdb_max_lock = 100000

  116. # Uncomment the following if you are using InnoDB tables
  117. #innodb_data_home_dir = /var/db/mysql/
  118. #innodb_data_file_path = ibdata1:10M:autoextend
  119. #innodb_log_group_home_dir = /var/db/mysql/
  120. #innodb_log_arch_dir = /var/db/mysql/
  121. # You can set .._buffer_pool_size up to 50 - 80 %
  122. # of RAM but beware of setting memory usage too high
  123. #innodb_buffer_pool_size = 256M
  124. #innodb_additional_mem_pool_size = 20M
  125. # Set .._log_file_size to 25 % of buffer pool size
  126. #innodb_log_file_size = 64M
  127. #innodb_log_buffer_size = 8M
  128. #innodb_flush_log_at_trx_commit = 1
  129. #innodb_lock_wait_timeout = 50

  130. [mysqldump]
  131. quick
  132. max_allowed_packet = 32M

  133. [mysql]
  134. no-auto-rehash
  135. # Remove the next comment character if you are not familiar with SQL
  136. #safe-updates

  137. [isamchk]
  138. key_buffer = 256M
  139. sort_buffer_size = 256M
  140. read_buffer = 2M
  141. write_buffer = 2M

  142. [myisamchk]
  143. key_buffer = 256M
  144. sort_buffer_size = 256M
  145. read_buffer = 2M
  146. write_buffer = 2M

  147. [mysqlhotcopy]
  148. interactive-timeout
复制代码
回复

使用道具 举报

ewenzhou 发表于 2008-10-17 12:53:33 | 显示全部楼层
简洁,但是不想用。
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

手机版|小黑屋|Discuz! 官方站 ( 皖ICP备16010102号 )star

GMT+8, 2024-11-18 17:39 , Processed in 0.024354 second(s), 3 queries , Gzip On, Redis On.

Powered by Discuz! X3.4

Copyright © 2001-2023, Tencent Cloud.

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