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

CentOS 7 installs mariadb in a common binary format

2025-03-31 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Database >

Share

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

System environment: CentOS 7 1611 (mariadb comes with the system after installation)

mariadb version: mariadb-5.5.56-linux-x86_64.tar.gz (Generic Linux)

Download address: mirrors.neusoft.edu.cn/mariadb//mariadb-galera-5.5.56/bintar-linux-x86_64/mariadb-galera-5.5.56-linux-x86_64.tar.gz

1. Download the universal binary program and expand it

[root@node1 tmp]# wget http://mirrors.neusoft.edu.cn/mariadb//mariadb-galera-5.5.56/bintar-linux-x86_64/mariadb-galera-5.5.56-linux-x86_64.tar.gz[root@node1 tmp]# tar -xf mariadb-5.56-linux-x86_64.tar.gz-C /usr/local/ #followed by mariadb installation path/usr/local

Create a directory to store the database and add mysql users

[root@node1 tmp]# mkdir -pv /mydata/data #Create directory where user stores data store files [root@node1 tmp]# useradd -r mysql #create mysql user as system user [root@node1 tmp]# chown mysql.mysql /mydata/data/ #Change the data storage path to mysql and mysql to group

3. Installation configuration mariadb

[root@node1 tmp]# cd /usr/local/[root@node1 local]# ln -sv mariadb-5.5.56-linux-x86_64 mysql'mysql' -> 'mariadb-5.5.56-linux-x86_64'[root@node1 local]# cd /usr/local/mysql/[root@node1 mysql]# chown -R root:mysql ./* #Modify/usr/local/mysql to root and mysql[root@node1 mysql]# ./ scripts/mysql_install_db --user=mysql --datadir=/mydata/data #Indicates the database file storage path and installation user [root@node1 mysql]# cp support-files/mysql.server /etc/init.d/mysqld #Add service startup script [root@node1 mysql]# chkconfig --add mysqld #Add service startup script to boot

4. Provide configuration files

[root@node1 mysql]# cp /etc/my.cnf{,.bak} #Backup mariadb configuration file [root@node1 mysql]# cp support-files/my-large.cnf /etc/my.cnf #Add system configuration script to default location [root@node1 mysql]# vim /etc/my.cnf [mysqld]datadir = /mydata/data #Indicates database file storage path innodb_file_per_table = ONskip_name_resolve = ON #Skip the process of resolving domain names when logging in to the database using IP

Common binary format installed service program its configuration file lookup order:

/etc/my.cnf --> /etc/mysql/my.cnf --> --default-extra-file=/PATH/TO/CONF_FILE --> ~/.my.cnf

Note: If the configuration file is not/etc/my.cnf, the configuration file path needs to be specified.

./ scripts/mysql_install_db --defaults-file=/PATH/TO/CONF_FILE (e.g.~/.my.cnf)

5. The installation is over, and the service can be started at this point.

[root@node1 mysql]# service mysqld start

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

Database

Wechat

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

12
Report