MARIADB log files, backup and restore basics

Source: Internet
Author: User

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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.