mysql 记录

mysql 区分大小写设置:

my.cnf

lower_case_table_names = 0

0:区分大小写,1:不区分大小写


修改swappiness参数,让操作系统尽可能最大程度利用物理内存,而非虚拟内存
$cat /proc/sys/vm/swappiness
60
$echo 0> /proc/sys/vm/swappiness

$echo "vm.swappiness=0" >> /etc/sysctl .conf
#立即生效
$ sysctl -p

如何查看那个进程占用swap的大小,如下:

1
2
3
4
5
6
7
8
第一步:
$ top
第二步:
按大写的O
第三步:
输入小写字母p
第四步:
回车

mysql主从从级联复制(A->B->C)

架构 master A ――�C> slave B――-> slave C

除正常配置主从配置文件外,需加在B的my.cnf上加log_slave_updates=1参数

log_slave_updates  是否从服务器从主服务器收到的更新应记入从服务器自己的二进制日志。要想生效,必须启用从服务器的二进制记录。


slave_skip_errors => ALL # 从服务器忽略所有错误


主从同步延时:

Because the log buffer is written out to the log file at each transaction commit and the flush to disk operation is performed on the log file. Writing and flushing operations are time expensive for only one transaction. It will be better to perform these operations for several transactions instead of only one.

SET GLOBAL innodb_flush_log_at_trx_commit = 0 

执行后解决,让innodb_flush_log_at_trx_commit=0  #不缓存,让事务实时写入。

echo -n 'Max processes=SOFT_LIMITS:HARD_LIMITS' > /proc/`pidof mysqld`/limits


你可能感兴趣的:(mysql,记录,区分大小写)