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

Compiling and installing Enterprise MariaDB Database based on the latest Source Code package of CentOS 6.8platform

2025-04-09 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Database >

Share

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

Installation environment

System: CentOS 6.8 x8664

MariaDB:enterprise 10.1.16

Resource acquisition

Download MariaDB Enterprise Edition, visit the address https://mariadb.com/my_portal/download/mariadb-enterprise. You need a login account to download it. You can register for free.

After logging in successfully, go to the MariaDB Enterprise Edition product download page, where a variety of installation packages such as binary and source code are provided. Choose the version 10.1.16GA according to the actual needs and download the source code package.

Confirm the tar.gz package download

Get the download address, copy it to the CentOS system and download it to the / usr/src directory using tools such as wget/curl.

Https://downloads.mariadb.com/enterprise/y21n-42b1/mariadb-enterprise/10.1.16/source/mariadb-enterprise-10.1.16.tar.gz

Download complete.

Installation process

Install the yum source for epel

Rpm-vih http://mirrors.aliyun.com/epel/epel-release-latest-6.noarch.rpm

In the case of yum cache, a new cache is generated.

Yum clean all

Yum makecache

Install the necessary software packages

Yum install-y ncurses-devel make cmake bison zlib zlib-devel openssl openssl-devel jemalloc gcc gcc-c++

Extract the installation package and use cmake configuration

Tar zxf mariadb-enterprise-10.1.16.tar.gz

Cd mariadb-10.1.16/

Cmake. -DCMAKE_INSTALL_PREFIX=/usr/local/mysql-DDEFAULT_SYSCONFDIR=/usr/local/mysql/etc-DMYSQL_DATADIR=/usr/local/mysql/data-DMYSQL_TCP_PORT=3306-DMYSQL_UNIX_ADDR=/usr/local/mysql/mysql.sock-DMYSQL_USER=mysql-DENABLED_LOCAL_INFILE=1-DEXTRA_CHARSETS=all-DDEFAULT_CHARSET=utf8-DDEFAULT_COLLATION=utf8_general_ci-DWITH_READLINE=1-DWITH_SSL=system-DWITH_ZLIB=system-DWITH_LIBWRAP=0

Compile with make, because the normal compilation time is quite long. To speed up compilation, multiple cpu cores are enabled to work at the same time, and-j 4 supports four core cpu compilations at the same time, saving time.

Make-j 4

Installation

Make install

Create MariaDB users and corresponding directories

Useradd-M-s / sbin/nologin mysql

Mkdir-p / usr/local/mysql/etc

Mkdir-p / usr/local/mysql/log

Mkdir-p / usr/local/mysql/run

If the / etc/my.cnf file exists, rename or delete it. And create a new profile

Rm-f / etc/my.cnf

Cp support-files/my-large.cnf.sh / usr/local/mysql/etc/my.cnf

Edit the configuration file vi / usr/local/mysql/etc/my.cnf to modify the port and socket parameters, and add them in the [mysqld] section

Log-error = / usr/local/mysql/log/mysqld.log

Pid-file = / usr/local/mysql/run/mysqld.pid

Modify the owner of the MariaDB installation directory

Chown-R mysql.mysql / usr/local/mysql/

Initialize the database

/ usr/local/mysql/scripts/mysql_install_db-user=mysql-basedir=/usr/local/mysql/-datadir=/usr/local/mysql/data

Start the database to view the process.

/ usr/local/mysql/bin/mysqld_safe &

Create a startup script file

Cp support-files/mysql.server / etc/init.d/mysql

Chmod 755 / etc/init.d/mysql

Modify / etc/init.d/mysql

Basedir=/usr/local/mysql

Datadir=/usr/local/mysql/data

Mysqld_pid_file_path=/usr/local/mysql/run/mysqld.pid

Add to chkconfig Management

Chkconfig-add mysql

Test script startup service

Set the root account login password for the database

/ usr/local/mysql/bin/mysqladmin-u root password '3Delimd0L7'

Log into the database

/ usr/local/mysql/bin/mysql-upright root'-pumped 3Droomd0L7'

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: 226

*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

Database

Wechat

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

12
Report