ubuntu 16 setup mariadb 10.0(a.k.a.mysql) log-error

OS: ubuntu16.04
mariadb 其实就是mysql, 只不过mysql被oracle收购,为防止oracle闭源,所以mysql社区外延出了mariadb。
之前一直修改my.cnf,但没什么效果,后来改动mariadb.cnf,成功指定log-error路径文件

安装
DEBIAN_FRONTEND=noninteractive + -y : 无交互安装

  • apt-get update && DEBIAN_FRONTEND=noninteractive apt-get install -y -V --no-install-recommends mariadb-server

文件路径

  • mysql dir: /etc/mysql/
  • data dir: /var/lib/mysql
  • log dir: /var/log/mysql

设置error log
mariadb.cnf 是my.cnf的最终link结果, 所以我们直接修改mariadb.cnf

  • /etc/mysql/my.cnf -> /etc/alternatives/my.cnf-> /etc/mysql/mariadb.cnf
    这里写图片描述

mariadb.cnf

default

# The MariaDB configuration file
#
# The MariaDB/MySQL tools read configuration files in the following order:
# 1. "/etc/mysql/mariadb.cnf" (this file) to set global defaults,
# 2. "/etc/mysql/conf.d/*.cnf" to set global options.
# 3. "/etc/mysql/mariadb.conf.d/*.cnf" to set MariaDB-only options.
# 4. "~/.my.cnf" to set user-specific options.
#
# If the same option is defined multiple times, the last one will apply.
#
# One can use all long options that the program supports.
# Run program with --help to get a list of available options and with
# --print-defaults to see which it would actually understand and use.

#
# This group is read both both by the client and the server
# use it for options that affect everything
#
[client-server]

# Import all .cnf files from configuration directory
!includedir /etc/mysql/conf.d/
!includedir /etc/mysql/mariadb.conf.d/

add code

[mysqld_safe]
log_error=/var/log/mysql/mysql_error.log

[mysqld]
log_error=/var/log/mysql/mysql_error.log

**http://www.pontikis.net/blog/how-and-when-to-enable-mysql-logs **

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值