Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

常用配置 #22

Open
clms2 opened this issue Oct 15, 2018 · 0 comments
Open

常用配置 #22

clms2 opened this issue Oct 15, 2018 · 0 comments

Comments

@clms2
Copy link
Owner

clms2 commented Oct 15, 2018

  • 慢查询记录到数据库:
log_output=table
slow_query_log=ON
long_query_time=2
  • 所有查询记录到文件:
general_log=ON
general_log_file=D:/phpenv/logs/query.log
  • 按照阿里云的参数配置的my.cnf,服务器16g内存

  • 如果linux已经设置好了ulimit,但是mysql不生效(查看/proc/msyqlpid/limits),问题的原因是systemctl启动方式覆盖了系统参数
    cat /usr/lib/systemd/system/mysqld.service | grep -A2 open_files_limit
    不建议修改mysqld.service,会影响mysql升级,使用以下方式:
    mkdir /usr/lib/systemd/system/mysqld.service.d

cat >> /usr/lib/systemd/system/mysqld.service.d/override.conf <<EOF
[Service]
LimitNOFILE=40960
EOF
  • 修改了mysql的data目录然后mysqld --initialize,需要再执行chown -R /datadir才能开启mysql
  • mysql主从配置
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant