- skip_ssl
关闭ssl
- character_set_server
mysql的字符集
- log_bin_trust_function_creators
二进制开启后,该参数默认开启。作用为信任存储函数创建者,不会创建写入二进制日志引起不安全事件的存储函数
- max_prepared_stmt_count
该值作用为同一个会话中,可以预处理sql的次数。默认为16382 可以调整为最大1048576
- skip_name_resolve
禁止域名解析
假如是开启域名解析,则会出现127.0.0.1 解析为localhost的情况,可能会无法连接,但是最主要的是为了性能,DNS解析有时候会很慢。
- lower_case_table_names
大小写是否敏感,Linux严格区分大小写,假如该值设置为1 则不区分大小写
- secure_file_priv
load data 或 select outfile的路径
- open_files_limit
mysqld进程最大打开的文件描述符的数量,
当然我们也需要去查看Linux的参数
/etc/security/limits.conf
如下的ochadoop 可以换成MySQL进程启动的用户名
# End of file
ochadoop soft nofile 1024000
ochadoop hard nofile 1024000
ochadoop soft nproc 65535
ochadoop hard nproc 65535
- max_connections
数据库最大连接数,设置少了就会 too many 。。。
- thread_cache_size
线程缓存数,作用为当客户端断开连接后,是在线程缓冲中找一个线程去服务,而不是重新创建线程,因为创建线程比较消耗资源。
mysql> show global status like '%Thread%';
+------------------------------------------+-------+
| Variable_name | Value |
+------------------------------------------+-------+
| Delayed_insert_threads | 0 |
| Performance_schema_thread_classes_lost | 0 |
| Performance_schema_thread_instances_lost | 0 |
| Slow_launch_threads | 0 |
| Threads_cached | 3 |
| Threads_connected | 11 |
| Threads_created | 14 |
| Threads_running | 1 |
+------------------------------------------+-------+
8 rows in set (0.00 sec)
mysql> show variables like '%thread_cache_size%';
+-------------------+-------+
| Variable_name | Value |
+-------------------+-------+
| thread_cache_size | 256 |
+-------------------+-------+
1 row in set (0.01 sec)
网友评论