コンパイルインストールmariadb


  :
CentOS6.9
    
     mariadb-10.2.12.tar.gz

1          mysql(        );

rpm -qa | grep mysql

[root@user ~ 13]#rpm -qa | grep mysql

2.        :

yum -y groupinstall development tools

yum  cmake ncurses-devel  gnutls-devel  libaio-devel

3.    :(           )

getent passwd mysql

[root@user ~ 16]#getent passwd mysql

4..  mysql    :

useradd -r mysql -s /sbin/nologin

[root@user ~ 17]#useradd -r mysql -s /sbin/nologin

mysql:x:990:305::/home/mysql:/sbin/nologin

5.      mariadb-10.2.12.tar.gz

tar xvf  mariadb-10.2.12.tar.gz -C /usr/local/

[root@user ~ 25]#tar xvf mariadb-10.2.12.tar.gz -C /usr/local/

6.cd     

[root@user ~ 25]#cd /usr/local/

[root@user /usr/local 26]#ls

bin  etc  games  include  lib  lib64  libexec  mariadb-10.2.12   mysql  sbin  share  src

7..  cmake  make && make install  (    30  )

cmake . \

-DCMAKE_INSTALL_PREFIX=/app/mysql \

-DMYSQL_DATADIR=/mysqldb/ \

-DSYSCONFDIR=/etc \

-DMYSQL_USER=mysql \

-DWITH_INNOBASE_STORAGE_ENGINE=1 \

-DWITH_ARCHIVE_STORAGE_ENGINE=1 \

-DWITH_BLACKHOLE_STORAGE_ENGINE=1 \

-DWITH_READLINE=1 \

-DWITH_SSL=system \

-DWITH_ZLIB=system \

-DWITH_LIBWRAP=0 \

-DMYSQL_UNIX_ADDR=/tmp/mysql.sock \

-DDEFAULT_CHARSET=utf8 \

-DDEFAULT_COLLATION=utf8_general_ci \

-DMYSQL_UNIX_ADDR=/tmp/mysql.sock \

-DENABLED_LOCAL_INFILE=1 \

-DWITH_PARTITION_STORAGE_ENGINE=1 \

-DWITH_DEBUG=0 \

-DWITHOUT_MROONGA_STORAGE_ENGINE=1

make && make install

8. /app    mysql      mysql   mysql

chown -R mysql.mysql mysql/   (    )

9.  mysql     ;support-file      .cnf            etc       :

cp -a myhuge.cnf /etc/my.cnf   (-a     )

10.  mysql.server     /etc/init.d/mysqld.sh(  fw)

cp -a mysql.server /etc/init.d/mysqld.sh

11.      :

cd /app/mysql/

scripts/mysql_installl_db --user=mysql   --datadir=/data/mtsqldb

   mysql                 (      )        

=  OK            ;

=

=12.      

#chkconfig --add mysqld

#chkconfig  mysqld on

[root@centos7 /app/mysql 106]#chkconfig --list mysqld

Note: This output shows SysV services only and does not include native

     systemd services. SysV configuration data might be overridden by native

     systemd configuration.

     If you want to list systemd services use 'systemctl list-unit-files'.

     To see services enabled on particular target use

     'systemctl list-dependencies [target]'.

mysqld         0:off 1:off 2:on 3:on 4:on 5:on 6:off

13.    :

#systemctl start mysqld

ss -tnl     3306        

14.      

mysql            mysql root