登录  注册 退出
苏杭php自学网
记录个人学习过程中碰见的问题和感受
要温柔,也要有屠龙的勇气
本站有学习资源,可自由下载学习资料
  1. 首页 > 数据库教程 > Mysql

mysql的配置文件优化

作者:苏杭 日期:2020-06-12 12:35:37 点击数:

以下针对的InnoDB引擎的配置文件my.cnf


[client]

socket = /var/lib/mysql/mysql.sock

port = 3306

 

[mysqld]

# GENERAL

datadir = /var/lib/mysql

socket = /var/lib/mysql/mysql.sock

pid_file = /var/lib/mysql/mysql.pid

user = mysql

port = 3306

 

# INNODB

innodb_buffer_pool_size = <value>

innodb_log_file_size = <value>

innodb_file_per_table = 1

 

# LOGGING

slow_query_log = ON

slow_query_log = /var/lib/mysql/mysql-slow.log

log_error = /var/lib/mysql/mysql-error.log

 

# OTHER

tmp_table_size = 32M

max_heap_table_size = 32M

# 禁用缓存

query_cache_type = 0

query_cache_size = 0

max_connections = <value>

thread_cache_size = <value>

open_files_limit = 65535

 

1. [client]

2. socket = /var/lib/mysql/mysql.sock

3. port = 3306

4. 

5. [mysqld]

6. # GENERAL

7. datadir = /var/lib/mysql

8. socket = /var/lib/mysql/mysql.sock

9. pid_file = /var/lib/mysql/mysql.pid

10. user = mysql

11. port = 3306

12. 

13. # INNODB

14. innodb_buffer_pool_size = <value>

15. innodb_log_file_size = <value>

16. innodb_file_per_table = 1

17. 

18. # LOGGING

19. slow_query_log = ON

20. slow_query_log = /var/lib/mysql/mysql-slow.log

21. log_error = /var/lib/mysql/mysql-error.log

22. 

23. # OTHER

24. tmp_table_size = 32M

25. max_heap_table_size = 32M

26. # 禁用缓存

27. query_cache_type = 0

28. query_cache_size = 0

29. max_connections = <value>

30. thread_cache_size = <value>

31. open_files_limit = 65535


mysql优化


随便看看
QQ在线咨询
电话:
182 7047 6708
交流微信:
su18270476708