mariadb the installation of linux

1 Overview

  mysql is a relational database.

       mysql branch - mysql ( itself ) - 2008 before and after the SUN acquisition of SUN and later by oracle takeover

              System Integration - do anything (- set of solutions )

              mariadb mysql After the acquisition, the authors database in order to avoid monopoly, the author based mysql earlier versions developed mariadb

              percona-server  in Europe, specifically mysql write manuals database,

       postgre SQL   himself that he is a relational data path of a company the industry leader

       oracle   of the most popular database

       mssql   Microsoft database

2, mariadb installation

  (1) Create a user

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

  (2) Unpack 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) Edit 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
#给mysql用户权限
[root@localhost mysql]# chown -R mysql.mysql /usr/local/mysql/ [root@localhost mysql]# chmod -R 755 /usr/local/mysql/

 Mysql initialization

[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 ...
OK
Filling help tables...
190910 12:38:06 [Note] /usr/local/mysql/bin/mysqld (mysqld 5.5.65-MariaDB) starting as process 12556 ...
OK

 Add the mysql service to the init.d

[root@localhost mysql]# cd support-files/
[root@localhost support-files]# cp -a mysql.server /etc/init.d/mysqld
启动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!

 

Guess you like

Origin www.cnblogs.com/shy13138/p/11498451.html