By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
434,587 Members | 1,079 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 434,587 IT Pros & Developers. It's quick & easy.

my.cnf errors..

P: 33
ok, so ill just say it, im new to mysql.. atleast when it comes to trying to modify it, i've read in places about how to make mysql run more efficiently for different servers, and so i tried to get a new file to use based on the hardware i have, but when i try to resart mysql from Putty, im getting this error..

/etc/init.d/mysql restart
error: Found option without preceding group in config file: /etc/my.cnf at line: 1
Fatal error in defaults handling. Program aborted
Restarting service MySQL
error: Found option without preceding group in config file: /etc/my.cnf at line: 1
Fatal error in defaults handling. Program aborted
Shutting down service MySQL done
error: Found option without preceding group in config file: /etc/my.cnf at line: 1
Fatal error in defaults handling. Program aborted
error: Found option without preceding group in config file: /etc/my.cnf at line: 1
Fatal error in defaults handling. Program aborted
Starting service MySQL done

and i cant really figure out why.. here is my.cnf file

Expand|Select|Wrap|Line Numbers
  1. ################################################################################
  2. #DATE: 2011-02-02
  3. #SITE: http://datastrangler.com
  4. #DESCRIPTION: MySQL config 5.0.x, 5.1.x, 5.5.x 
  5. #RAM: 2GB RAM dedicated server
  6. #Connections: 500 connections
  7. ################################################################################
  8. #[mysqld_safe]
  9. #nice                 = -15
  10. #
  11. #[client]
  12. #socket                 = /var/lib/mysql/mysql.sock
  13. #default-character-set         = utf8
  14. #
  15. [mysqld]
  16. ## Charset and Collation
  17. character-set-server         = utf8
  18. collation-server         = utf8_general_ci
  19.  
  20. ## Files
  21. back_log             = 300
  22. open-files-limit         = 8192
  23. open-files             = 1024    
  24. port                 = 3306
  25. socket                 = /var/lib/mysql/mysql.sock
  26. pid-file             = /var/lib/mysql/mysql.pid
  27. skip-external-locking
  28. skip-name-resolve
  29.  
  30. ## Logging
  31. datadir                = /var/lib/mysql
  32. relay_log            = mysql-relay-bin
  33. relay_log_index            = mysql-relay-index
  34. #log                = mysql-gen.log    
  35. log_error            = mysql-error.err
  36. log_warnings
  37. log_bin                = mysql-bin
  38. log_slow_queries        = mysql-slow.log
  39. #log_queries_not_using_indexes
  40. long_query_time         = 10    #default: 10
  41. max_binlog_size         = 256M    #max size for binlog before rolling
  42. expire_logs_days         = 4    #binlog files older than this will be purged
  43.  
  44. ## Per-Thread Buffers * (max_connections) = total per-thread mem usage
  45. thread_stack             = 256K      #default: 32bit: 192K, 64bit: 256K
  46. sort_buffer_size         = 256K      #default: 2M, larger may cause perf issues
  47. read_buffer_size         = 256K      #default: 128K, change in increments of 4K
  48. read_rnd_buffer_size         = 256K      #default: 256K                
  49. join_buffer_size         = 256K      #default: 128K
  50. binlog_cache_size         = 64K      #default: 32K, size of buffer to hold TX queries
  51. ## total per-thread buffer memory usage: 672000K = 656.25MB
  52.  
  53. ## Query Cache
  54. query_cache_size         = 32M    #global buffer
  55. query_cache_limit         = 512K    #max query result size to put in cache
  56.  
  57. ## Connections
  58. max_connections         = 500    #multiplier for memory usage via per-thread buffers
  59. max_connect_errors         = 100    #default: 10
  60. concurrent_insert        = 2    #default: 1, 2: enable insert for all instances
  61. connect_timeout            = 30    #default -5.1.22: 5, +5.1.22: 10
  62. max_allowed_packet         = 32M    #max size of incoming data to allow
  63.  
  64. ## Default Table Settings
  65. sql_mode             = NO_AUTO_CREATE_USER
  66.  
  67. ## Table and TMP settings
  68. max_heap_table_size         = 128M    #recommend same size as tmp_table_size
  69. bulk_insert_buffer_size     = 128M    #recommend same size as tmp_table_size
  70. tmp_table_size                  = 128M 
  71. #tmpdir                         = /data/mysql-tmp0:/data/mysql-tmp1 #Recommend using RAMDISK for tmpdir
  72.  
  73. ## Table cache settings
  74. #table_cache             = 512    #5.0.x <default: 64>
  75. #table_open_cache        = 512    #5.1.x, 5.5.x <default: 64>
  76.  
  77. ## Thread settings
  78. thread_concurrency        = 4  #recommend 2x CPU cores
  79. thread_cache_size        = 100 #recommend 5% of max_connections
  80.  
  81. ## Replication
  82. #read_only
  83. #skip-slave-start        
  84. #slave-skip-errors        = <default: none, recommend:1062>
  85. #slave-net-timeout        = <default: 3600>
  86. #slave-load-tmpdir        = <location of slave tmpdir>
  87. #slave_transaction_retries    = <default: 10>
  88. #server-id                      = <unique value>
  89. #replicate-same-server-id       = <default: 0, recommend: 0, !if log_slave_updates=1> 
  90. #auto-increment-increment       = <default: none>
  91. #auto-increment-offset          = <default: none>
  92. #master-connect-retry           = <default: 60>
  93. #log-slave-updates        = <default: 0 disable>
  94. #report-host            = <master_server_ip>
  95. #report-user            = <replication_user>
  96. #report-password                = <replication_user_pass>
  97. #report-port            = <default: 3306>
  98. #replicate-do-db                =
  99. #replicate-ignore-db        =
  100. #replicate-do-table        = 
  101. #relicate-ignore-table        =
  102. #replicate-rewrite-db        =
  103. #replicate-wild-do-table    =
  104. #replicate-wild-ignore-table    =
  105.  
  106. ## Replication Semi-Synchronous 5.5.x only, requires dynamic plugin loading ability 
  107. #rpl_semi_sync_master_enabled    = 1 #enable = 1, disable = 0
  108. #rpl_semi_sync_master_timeout    = 1000 #in milliseconds <default: 10000>, master only setting
  109.  
  110. ## 5.1.x and 5.5.x replication related setting. 
  111. #binlog_format            = MIXED
  112.  
  113. ## MyISAM Engine
  114. key_buffer            = 512K    #global buffer
  115. myisam_sort_buffer_size        = 128M    #index buffer size for creating/altering indexes
  116. myisam_max_sort_file_size    = 256M    #max file size for tmp table when creating/alering indexes
  117. myisam_repair_threads        = 4    #thread quantity when running repairs
  118. myisam_recover            = BACKUP    #repair mode, recommend BACKUP 
  119.  
  120. ## InnoDB Plugin Dependent Settings
  121. #ignore-builtin-innodb
  122. #plugin-load=innodb=ha_innodb_plugin.so;innodb_trx=ha_innodb_plugin.so;innodb_locks=ha_innodb_plugin.so;innodb_cmp=ha_innodb_plugin.so;innodb_cmp_reset=ha_innodb_plugin.so;innodb_cmpmem=ha_innodb_plugin.so;innodb_cmpmem_reset=ha_innodb_plugin.so;innodb_lock_waits=ha_innodb_plugin.so
  123.  
  124. ## InnoDB IO Capacity - 5.1.x plugin, 5.5.x
  125. #innodb_io_capacity        = 200
  126.  
  127. ## InnoDB IO settings -  5.1.x only
  128. #innodb_file_io_threads        = 16
  129.  
  130. ## InnoDB IO settings -  5.5.x and greater
  131. #innodb_write_io_threads     = 16
  132. #innodb_read_io_threads        = 16
  133.  
  134. ## InnoDB Plugin Independent Settings
  135. innodb_data_home_dir            = /var/lib/mysql
  136. innodb_data_file_path        = ibdata1:128M;ibdata2:10M:autoextend
  137. innodb_log_file_size        = 64M    #64G_RAM+ = 768, 24G_RAM+ = 512, 8G_RAM+ = 256, 2G_RAM+ = 128 
  138. innodb_log_files_in_group    = 4    #combined size of all logs <4GB. <2G_RAM = 2, >2G_RAM = 4
  139. innodb_buffer_pool_size        = 768M     #global buffer
  140. innodb_additional_mem_pool_size    = 4M    #global buffer
  141. innodb_status_file              #extra reporting
  142. innodb_file_per_table            #enable always
  143. innodb_flush_log_at_trx_commit    = 2    #2/0 = perf, 1 = ACID
  144. innodb_table_locks        = 0    #preserve table locks
  145. innodb_log_buffer_size         = 32M     #global buffer
  146. innodb_lock_wait_timeout     = 60    
  147. innodb_thread_concurrency    = 16    #recommend 2x core quantity
  148. innodb_commit_concurrency    = 16    #recommend 4x num disks
  149. #innodb_flush_method        = O_DIRECT       #O_DIRECT = local/DAS, O_DSYNC = SAN/iSCSI
  150. innodb_support_xa        = 0           #recommend 0, disable xa to negate extra disk flush
  151. skip-innodb-doublewrite
  152.  
  153. ## Binlog sync settings
  154. ## XA transactions = 1, otherwise set to 0 for best performance
  155. sync_binlog            = 0
  156.  
  157. ## TX Isolation
  158. transaction-isolation        = REPEATABLE-READ #REPEATABLE-READ req for ACID, SERIALIZABLE req XA
  159.  
  160. ## Per-Thread Buffer memory utilization equation:
  161. #(read_buffer_size + read_rnd_buffer_size + sort_buffer_size + thread_stack + join_buffer_size + binlog_cache_size) * max_connections
  162.  
  163. ## Global Buffer memory utilization equation:
  164. # innodb_buffer_pool_size + innodb_additional_mem_pool_size + innodb_log_buffer_size + key_buffer_size + query_cache_size
  165.  
  166. [mysqldump]
  167. quick
  168. quote-names
  169. max_allowed_packet         = 128M
  170.  
any ideas would be appreciated... thanks
gt
Jan 9 '12 #1
Share this question for a faster answer!
Share on Google+

Post your reply

Sign in to post your reply or Sign up for a free account.