Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

Mariadb installation steps

2025-02-25 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Database >

Share

Shulou(Shulou.com)06/01 Report--

Download address: https://downloads.mariadb.org/mariadb/10.2.10/

# # [client]

Port = 3306

Socket = / data/mysql/data/mysql.sock

[mysql]

Prompt = "\ u@rac2\ R:\ m:\ s [\ d] >"

[mysqld]

User = mysql

Port = 3306

Basedir = / opt/mysql

Datadir = / data/mysql/data

Socket = / data/mysql/data/mysql.sock

Slow_query_log = 1

Slow_query_log_file = / data/mysql/data/slow.log

Log-error = / data/mysql/data/error.log

Long_query_time = 0.5

Log_queries_not_using_indexes = 1

Log_throttle_queries_not_using_indexes = 60

Log_slow_admin_statements = 1

Log_slow_slave_statements = 1

Server-id = 3306

Log-bin = / data/mysql/data/mybinlog

Sync_binlog = 1

Expire_logs_days = 30

Transaction_isolation = REPEATABLE-READ

Innodb_buffer_pool_size = 50m

Innodb_buffer_pool_instances = 1

Innodb_buffer_pool_load_at_startup = 1

Innodb_buffer_pool_dump_at_shutdown = 1

# innodb_data_file_path = ibdata1:50M:autoextend

Innodb_flush_log_at_trx_commit = 1

Innodb_log_buffer_size = 32m

Innodb_log_file_size = 50m

Innodb_log_files_in_group = 2

Innodb_max_undo_log_size = 200m

# alias mysql3306='/opt/mysql/bin/mysql [mariadb]

Name = MariaDB

Baseurl = http://yum.mariadb.org/10.2/centos6-amd64

Gpgkey= https://yum.mariadb.org/RPM-GPG-KEY-MariaDB

Gpgcheck=0

Enabled=1 yum install boost

Yum install MariaDB-server MariaDB-client

Sudo systemctl start mariadb

Sudo / etc/init.d/mysql start

Reference address: https://mariadb.com/kb/en/library/yum/ reference address: https://downloads.mariadb.org/mariadb/repositories/#mirror=neusoft&distro=CentOS&distro_release=centos6-amd64--centos6&version=10.2## source installation

Installation package mariadb-10.2.10.tar software directory / opt/mysql data directory / data/mysql/data

Yum install-y ncurses-devel openssl-devel openssl gcc-c++ cmake groupadd mysql

Useradd-g mysql mysql [mysqld]

Datadir=/data/mariadb/data

Socket=/data/mariadb/data/mysql.sock

User=mysql

# Disabling symbolic-links is recommended to prevent assorted security risks

Symbolic-links=0

[mysqld_safe]

Log-error=/var/log/mysqld.log

Pid-file=/data/mariadb/data/mysqld.pid

Export PATH=$PATH:/usr/local/mysql

Chown-R mysql / data/mariadb

Start mysql mysqld_safe-- defaults-file=/usr/local/mysql/my.cnf &

Log in to mysql mysql-uroot-p-- socket=/data/mariadb/data/mysql.sock

Reference document: https://www.cnblogs.com/daixiang/p/5431639.html

# # how to upgrade mysql

1. Install a new version of MySQL on the target server

two。 Create a database mysqladmin-h hostname-P port-u user-p passwd create db_name 3. 0 with the same name as the old version on the new version of MySQL. Import the database from the old version of MySQL into the new version through the pipeline. The command is as follows: mysqldump-- opt db_name | mysql-h hostname-P port-u user-p passwd

Db_name

Note:-- the opt option indicates the use of Optimize for export

If the network is slow, you can add-compress to the export option to reduce network transfer. For operating systems that do not support the pipe operator (|), you can first use the mysqldump tool to export the old version of data to a text file, and then import this file into the new version of MySQL

Shell > mysqldump-- opt db_name > filename (executed on older versions of MySQL)

Shell > mysql-u user-p passwd db_name < filename (executed on the new version of MySQL)

4. Cp all the mysql database directories in the old version of MySQL to overwrite the mysql database in the new version of MySQL.

# configure GTID mysqld_safe-- gtid_mode=ON-- log-bin-- log-slave-updates-- enforce-gtid-consistency &. / bin/mysqld_safe-- defaults-file=/data/opt/mysql/my.cnf-- user=mysql-- gtid_mode=ON-- log-bin-- log-slave-updates &

Master-slave configuration gtid reference http://blog.csdn.net/wuxbeyond/article/details/49615359

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report