viewza565

Tuning MySQL for Shared Hosting Directadmin on CentOS 7

Mar 23rd, 2016
275
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.39 KB | None | 0 0
  1. #Edit File
  2. $ vi /etc/my.cnf.d/server.cnf
  3.  
  4. #Add Config in next line : [mysqld]
  5.  
  6. [mysqld]
  7. local-infile=0
  8.  
  9. #skip-innodb
  10. innodb_buffer_pool_size=256M
  11. #innodb_additional_mem_pool_size=4M
  12. innodb_log_buffer_size=2M
  13. innodb_flush_log_at_trx_commit = 1
  14. innodb_thread_concurrency=2
  15. #innodb_log_file_size = 256M
  16. innodb_file_per_table
  17.  
  18. skip-character-set-client-handshake
  19. skip-name-resolve
  20. max_connections = 300
  21. key_buffer = 512M
  22. myisam_sort_buffer_size = 32M
  23. join_buffer_size = 1M
  24. read_buffer_size = 1M
  25. sort_buffer_size = 2M
  26. read_rnd_buffer_size = 1M
  27.  
  28. table_cache = 1536
  29. thread_cache = 4
  30. thread_concurrency = 2
  31. thread_cache_size = 256
  32. wait_timeout = 3600
  33. connect_timeout = 10
  34. max_tmp_tables = 256
  35. tmp_table_size = 128M
  36. max_allowed_packet = 16M
  37. max_connect_errors = 10
  38. query_cache_limit = 1M
  39. query_cache_size = 32M
  40. query_cache_type = 1
  41. query_prealloc_size = 16384
  42. query_alloc_block_size = 16384
  43. max_heap_table_size = 128M
  44. #tmpdir=/var/mysqltmp
  45.  
  46. log_warnings=0
  47.  
  48. [mysqld_safe]
  49. #log-error=/var/log/mysqld.log
  50. #pid-file=/var/run/mysqld/mysqld.pid
  51. open_files_limit = 16384
  52.  
  53. #Save.. & Restart MySQL Service
  54.  
  55. $ systemclt restart mysqld.service
  56.  
  57. #Finished.
  58.  
  59. # Linux Tips : https://www.reddit.com/user/ihotvps/
  60. # My Web Official : https://www.ihotvps.com
Add Comment
Please, Sign In to add comment