Installation of mariadb in linux

1. Overview

mysql is a relational database.

mysql (itself), a branch of mysql, was acquired by SUN before and after 2008 and then by oracle.

System integration - everything is done (set solution)

After the acquisition of mariadb mysql, the author developed mariadb based on earlier versions of MySQL in order to avoid the monopoly of the database.

percona-server in Europe specializes in writing Handbooks for mysql databases.

Posgre SQL says it's the biggest company in the relational data path industry

oracle's most popular database

mssql database

2. mariadb Installation

(1) Create users

[root@localhost ~]# groupadd mysql
[root@localhost ~]# useradd -r -g mysql -s /sbin/nologin mysql

(2) Decompress and install

[root@localhost ~]# tar xf mariadb-5.5.65-linux-systemd-x86_64.gz 
[root@localhost ~]# mv mariadb-5.5.65-linux-systemd-x86_64 /usr/local/mysql

(3) Editing my.cnf file


[root@localhost mysql]# cp support-files/my-small.cnf /etc/my.cnf
cp: overwrite '/etc/my.cnf'? y
[root@localhost mysql]# vim /etc/my.cnf
  [mysqld]   port = 3306   socket = /tmp/mysql.sock   skip-external-locking   key_buffer_size = 16K   max_allowed_packet = 1M   table_open_cache = 4   sort_buffer_size = 64K   read_buffer_size = 256K   read_rnd_buffer_size = 256K   net_buffer_length = 2K   thread_stack = 240K   basedir = /usr/local/mysql   datadir = /usr/local/mysql/data   innodb_file_per_table=on   skip_name_resolve = on
#to mysql User privileges
[root@localhost mysql]# chown -R mysql.mysql /usr/local/mysql/ [root@localhost mysql]# chmod -R 755 /usr/local/mysql/

Initialize mysql

[root@localhost mysql]# /usr/local/mysql/scripts/mysql_install_db --user=mysql
Installing MariaDB/MySQL system tables in '/usr/local/mysql/data' ...
190910 12:38:06 [Note] /usr/local/mysql/bin/mysqld (mysqld 5.5.65-MariaDB) starting as process 12547 ...
Filling help tables...
190910 12:38:06 [Note] /usr/local/mysql/bin/mysqld (mysqld 5.5.65-MariaDB) starting as process 12556 ...

Add mysql service to init.d

[root@localhost mysql]# cd support-files/
[root@localhost support-files]# cp -a mysql.server /etc/init.d/mysqld
start-up mysql [root@localhost support-files]# /etc/init.d/mysqld start Starting MariaDB.190910 12:40:15 mysqld_safe Logging to '/usr/local/mysql/data/localhost.localdomain.err'. 190910 12:40:15 mysqld_safe Starting mysqld daemon with databases from /usr/local/mysql/data . SUCCESS!

Keywords: Linux MySQL MariaDB Database Oracle

Added by hyd_guy on Thu, 03 Oct 2019 02:33:29 +0300