PostIT

[MariaDB/CentOS] CentOS에서 MariaDB설치(Repo 설정) - 퍼옴 본문

Linux/Linux

[MariaDB/CentOS] CentOS에서 MariaDB설치(Repo 설정) - 퍼옴

shun10114 2016. 12. 3. 15:00

http://www.2daygeek.com/install-upgrade-mariadb-10-on-centos-rhel-fedora/

- CentOS를 접하면서....많은 경험과 배움을 얻는 중. 먼저, mariaDB를 그냥 설치하면 5.5버전 배포판이 깔리게 되는데, 꼭 Repo설정을 하자.


1) Add MariaDB Repositories

By default MariaDB 5.x Series was included all the Linux distribution and removed MySQL but they didn’t include MariaDB 10.x series and if you want Add MariaDB Repositories, use the below commands to add MariaDB Repositories on CentOS, RHEL & Fedora systems.

First Create file /etc/yum.repos.d/MariaDB.repo then Copy and paste it.

# For CentOS 7 Systems #
[mariadb]
name = MariaDB
baseurl = http://yum.mariadb.org/10.1/centos7-amd64
gpgkey=https://yum.mariadb.org/RPM-GPG-KEY-MariaDB
gpgcheck=1

# For CentOS 6 Systems #
[mariadb]
name = MariaDB
baseurl = http://yum.mariadb.org/10.1/centos6-amd64
gpgkey=https://yum.mariadb.org/RPM-GPG-KEY-MariaDB
gpgcheck=1

For RHEL Systems : First Create file /etc/yum.repos.d/MariaDB.repo then Copy and paste it.

# For RHEL 7 Systems #
[mariadb]
name = MariaDB
baseurl = http://yum.mariadb.org/10.1/rhel7-amd64
gpgkey=https://yum.mariadb.org/RPM-GPG-KEY-MariaDB
gpgcheck=1

# For RHEL 6 Systems #
[mariadb]
name = MariaDB
baseurl = http://yum.mariadb.org/10.1/rhel6-amd64
gpgkey=https://yum.mariadb.org/RPM-GPG-KEY-MariaDB
gpgcheck=1

For Fedora Systems : First Create file /etc/yum.repos.d/MariaDB.repo then Copy and paste it.

# For Fedora 23 Systems #
[mariadb]
name = MariaDB
baseurl = http://yum.mariadb.org/10.1/fedora23-amd64
gpgkey=https://yum.mariadb.org/RPM-GPG-KEY-MariaDB
gpgcheck=1

# For Fedora 22 Systems #
[mariadb]
name = MariaDB
baseurl = http://yum.mariadb.org/10.1/fedora22-amd64
gpgkey=https://yum.mariadb.org/RPM-GPG-KEY-MariaDB
gpgcheck=1

3) Install MariaDB

After adding MariaDB repository, just fire the below command to install MariaDB 10 on your systems.

# For RHEL/CentOS/Fedora 21 & older Systems #
# yum install MariaDB-server MariaDB-client

# For RHEL/CentOS/Fedora 22 & later Systems #
# dnf install MariaDB-server MariaDB-client

3) Start MariaDB Service

Use the below command to start MariaDB server for further usage.

# For SysVinit Systems #
# service mysql start

# For systemd Systems #
# systemctl start mysql.service

4) Secure MariaDB

By default MariaDB wont have root password and it’s security issue. So, run the below command to secure MariaDB installation, This will set root password for MariaDB also set other permission and remove test databases too.

# mysql_secure_installation

5) How to access MariaDB

Use the below command to access MariaDB service.

# mysql -u root -p

Welcome to the MariaDB monitor.  Commands end with ; or \g.
Your MariaDB connection id is 3
Server version: 10.1.11-MariaDB MariaDB Server

Copyright (c) 2000, 2015, Oracle, MariaDB Corporation Ab and others.

Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.

MariaDB [(none)]> 

6) How to Upgrade MariaDB

Use the below command to Upgrade MariaDB service for new release

# For RHEL/CentOS/Fedora 21 & older Systems #
# yum upgrade MariaDB-server MariaDB-client

# For RHEL/CentOS/Fedora 22 & later Systems #
# dnf upgrade MariaDB-server MariaDB-client

Also read about phpMyAdmin Installation and configuration which will help you to manage the MariaDB database on Web without headache.

Comments