mariadb log file
CentOS 7 Compile and install MARIADB
[Email protected] ~]# yum-y groupinstall "Development Tools"
[email protected] ~]# Yum install ncurses-devel openssl-devel libevent-devel jemalloc-devel cmake-y
[Email protected] ~]# Tar XF mariadb-5.5.53.tar.gz
[Email protected] ~]# CD mariadb-5.5.53/
[Email protected] mariadb-5.5.53]# CMake. -dcmake_install_prefix=/usr/local/mariadb-5.5.53 \
-dmysql_datadir=/mydata/data \
-DSYSCONFDIR=/ETC \
-dwith_innobase_storage_engine=1 \
-dwith_archive_storage_engine=1 \
-dwith_blackhole_storage_engine=1 \
-dwith_readline=1 \
-dwith_ssl=system \
-dwith_zlib=system \
-dwith_libwrap=0 \
-dmysql_unix_addr=/tmp/mysql.sock \
-ddefault_charset=utf8 \
-ddefault_collation=utf8_general_ci
[[email protected] mariadb-5.5.53]# make && make install
[Email protected] ~]# Vim/usr/lib/systemd/system/mariadb.service
# Don ' t forget to reload SYSTEMD daemon after you change unit configuration:
# # root> Systemctl--system daemon-reload
#
[Unit]
DESCRIPTION=MARIADB Database Server
After=syslog.target
After=network.target
#
[Service]
Type=simple
User=mysql
Group=mysql
#
# Note:we set--basedir to prevent probes that might trigger SELinux alarms,
Execstart=/usr/local/mysql/bin/mysqld_safe--basedir=/usr/local/mysql
#
# Give A reasonable amount of time for the server to start Up/shut down
timeoutsec=300
#
# Place temp files in a secure directory, not/tmp
Privatetmp=false
#
[Install]
Vantedby=multi-user.target
[[email protected] mysql]# groupadd-r-G, MySQL
[[email protected] mysql]# useradd-r-G mysql-u
[Email protected] ~]# Systemctl daemon-reload
[email protected] mariadb-5.5.53]# CP support-files/my-large.cnf/etc/my.cnf
[Email protected] mariadb-5.5.53]# VIM/ETC/MY.CNF
Add to
DataDir =/data/mysql
[Email protected] mariadb-5.5.53]# cd/usr/local/
[Email protected] local]# ln-s mariadb-5.5.53/mysql
[Email protected] local]# CD mysql/
[Email protected] mysql]# mkdir/data/mysql-p
[Email protected] mysql]# chown mysql.mysql/data/mysql/
[Email protected] mysql]# chown-r mysql.mysql./*
[Email protected] mysql]# scripts/mysql_install_db--user=mysql--datadir=/data/mysql
[Email protected] mysql]# systemctl start Mariadb.service
#慢查询
MariaDB [(None)]> SHOW GLOBAL VARIABLES like ' long_query_time ';
+-----------------+-----------+
| variable_name | Value |
+-----------------+-----------+
| Long_query_time | 10.000000 |
+-----------------+-----------+
1 row in Set (0.00 sec)
#日志查询
[Email protected] bin]#/mysqlbinlog--start-position=328/data/mysql/mysql-bin.000004
This article is from the "Chase Dream" blog, please be sure to keep this source http://sihua.blog.51cto.com/377227/1867336
MARIADB log files, backup and restore basics