MySQL的配置路径: /etc/mysql/mysql.conf.d/mysqld.cnf
默认配置如下:
# Here you can see queries with especially long duration #log_slow_queries = /var/log/mysql/mysql-slow.log #long_query_time = 2 #log-queries-not-using-indexes
如果只是把这注释去掉,发现启动是启动不了的,错误如下:
Job for mysql.service failed because the control process exited with error code. See "systemctl status mysql.service" and "journalctl -xe" for details.
运行 systemctl status mysql.service
查看是如下错误:
● mysql.service - MySQL Community Server Loaded: loaded (/lib/systemd/system/mysql.service; enabled; vendor preset: enabled) Active: activating (start-post) (Result: exit-code) since Fri 2017-11-10 23:57:05 CST; 15s ago Process: 16048 ExecStart=/usr/sbin/mysqld (code=exited, status=1/FAILURE) Process: 16040 ExecStartPre=/usr/share/mysql/mysql-systemd-start pre (code=exited, status=0/SUCCESS) Main PID: 16048 (code=exited, status=1/FAILURE); : 16049 (mysql-systemd-s) CGroup: /system.slice/mysql.service └─control ├─16049 /bin/bash /usr/share/mysql/mysql-systemd-start post └─16108 sleep 1 Nov 10 23:57:05 xyz systemd[1]: Starting MySQL Community Server... Nov 10 23:57:07 xyz systemd[1]: mysql.service: Main process exited, code=exited, status=1/FAILURE
把配置修改成下面这样,启动配置成功。
# Here you can see queries with especially long duration slow_query_log = 1 slow_query_log_file = /var/log/mysql/mysql-slow.log long_query_time = 3 # 下面的错误的 #log_slow_queries = /var/log/mysql/mysql-slow.log #long_query_time = 2 #log-queries-not-using-indexes
详情见https://dev.mysql.com/doc/refman/5.7/en/slow-query-log.html
stat -c "%a %n" file , 755, 644
ModuleNotFoundError: No module named 'MySQLdb', ...
Ubuntu18.04下使用pyenv安装python报错:BUILD FAILED (Ubun ...
dell提供了工具远程查看服务器硬件状态,可以修改硬件的参数,可以远程连接过去直接修改,就不需要 ...
启动报undefined symbol: EVP_CIPHER_CTX_cleanup错误。op ...
ubuntu开启crontab日志记录及解决No MTA installed, discardi ...
暂时还没有评论,第一个来评论吧!