In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-01-25 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Database >
Share
Shulou(Shulou.com)05/31 Report--
This article mainly introduces "how to install MariaDB database in CentOS7.X". In daily operation, I believe many people have doubts about how to install MariaDB database in CentOS7.X. The editor consulted all kinds of materials and sorted out simple and easy-to-use methods of operation. I hope it will be helpful to answer the doubts about "how to install MariaDB database in CentOS7.X". Next, please follow the editor to study!
Prepare before installing the database:
1. View the virtual machine version
[root@ywl0115 ~] # cat / etc/centos-releaseCentOS Linux release 7.3.1611 (Core)
2. Check whether the virtual machine has its own MariaDB database.
[root@ywl0115 ~] # rpm-qa | grep mariadbmariadb-libs-5.5.52-1.el7.x86_64
3. If you have a MariaDB database, uninstall the
[root@ywl0115] # rpm-e mariadb-libs-5.5.52-1.el7.x86_64
Add yum source and install database
1. Add MariaDB.repo file
Yum connection to MaraDB data official website
Https://downloads.mariadb.org/mariadb/repositories/#mirror=tuna&distro=CentOS&distro_release=centos7-amd64--centos7&version=10.2
Copy the text of the red box to MariaDB.repo when the version is selected
[root@ywl0115 ~] # cd / etc/yum.repos.d/ [root@ywl0115 yum.repos.d] # lsCentOS-Base.repo CentOS-Debuginfo.repo CentOS-Media.repo CentOS-Vault.repoCentOS-CR.repo CentOS-fasttrack.repo CentOS-Sources.repo [root@ywl0115 yum.repos.d] # vim MariaDB.repo [root@ywl0115 yum.repos.d] # lsCentOS-Base.repo CentOS-Debuginfo.repo CentOS-Media.repo CentOS-Vault.repoCentOS-CR.repo CentOS-fasttrack.repo CentOS-Sources .repo MariaDB.repo [root@ywl0115 yum.repos.d] # cat MariaDB.repo # MariaDB 10.2 CentOS repository list-created 2019-01-18 09:12 UTC# http://downloads.mariadb.org/mariadb/repositories/[mariadb]name = MariaDBbaseurl = http://yum.mariadb.org/10.2/centos7-amd64gpgkey=https://yum.mariadb.org/RPM-GPG-KEY-MariaDBgpgcheck=1[root@ywl0115 yum.repos.d] #
2. Use YUM to install the database MariaDB
(1), yum installation
The yum-y install MariaDB-client MariaDB-server MariaDB-devel parameter-y is confirmed. There is no need to prompt. When you do not enter, you will be prompted to select MariaDB-server: server-side MariaDB-client: client to connect and operate the Mysql server. MariaDB-devel: contains the first files for development and some static libraries, and can not be installed. If you want to compile other MySQL clients, such as Perl modules, you need to install the RPM package.
(2) start the database
[root@ywl0115 ~] # systemctl start mariadb # # enable [root@ywl0115 ~] # systemctl status mariadb # # View status ● mariadb.service-MariaDB 10.2.21 database server Loaded: loaded (/ usr/lib/systemd/system/mariadb.service; enabled; vendor preset: disabled) Drop-In: / etc/systemd/system/mariadb.service.d └─ migrated-from-my.cnf-settings.conf Active: active (running) since Fri 2019-01-18 17:49:39 CST 8s ago Docs: man:mysqld (8) https://mariadb.com/kb/en/library/systemd/ Process: 2598 ExecStartPost=/bin/sh-c systemctl unset-environment _ WSREP_START_POSITION (code=exited, status=0/SUCCESS) Process: 2553 ExecStartPre=/bin/sh-c [!-e / usr/bin/galera_recovery] & & VAR= | | VAR= `/ usr/bin/galera_ recovery` [$?-eq 0] & & systemctl set-environment _ WSREP_START_POSITION=$VAR | | exit 1 (code=exited, status=0/SUCCESS) Process: 2551 ExecStartPre=/bin/sh-c systemctl unset-environment _ WSREP_START_POSITION (code=exited, status=0/SUCCESS) Main PID: 2565 (mysqld) Status: "Taking your SQL requests now..." CGroup: / system.slice/mariadb.service └─ 2565 / usr/sbin/mysqldJan 18 17:49:39 ywl0115.novalocal mysqld [2565]: 2019-01-18 17:49:39 140654635174016 [Note] Pl...d.Jan 18 17:49:39 ywl0115.novalocal mysqld [2565]: 2019-01-18 17:49:39 140653568702208 [Note] In...39Jan 18 17:49:39 ywl0115.novalocal mysqld [2565]: 2019-01-18 17:49:39 140654635174016 [Note] Se... Jan 18 17:49:39 ywl0115.novalocal mysqld [2565]: 2019-01-18 17:49:39 140654543447808 [Warning]... deJan 18 17:49:39 ywl0115.novalocal mysqld [2565]: 2019-01-18 17:49:39 140654543447808 [Warning]... deJan 18 17:49:39 ywl0115.novalocal mysqld [2565]: 2019-01-18 17:49:39 140654635174016 [Note] Re...edJan 18 17:49:39 ywl0115.novalocal mysqld [2565]: 2019-01-18 17 49:39 140654635174016 [Note] Ad...leJan 18 17:49:39 ywl0115.novalocal mysqld [2565]: 2019-01-18 17:49:39 140654635174016 [Note] / u...s.Jan 18 17:49:39 ywl0115.novalocal mysqld [2565]: Version: '10.2.21 database server.Hint' socket:'/ var/lib...erJan 18 17:49:39 ywl0115.novalocal systemd [1]: Started MariaDB 10.2.21 database server.Hint: Some lines were ellipsized Use-l to show in full.
If you see:
Active: active (running) since Fri 2019-01-18 17:49:39 CST; 8s ago
Start successfully.
(3), MariaDB security configuration (this is the biggest difference from MySQL)
Enter the command: mysql_secure_installation ①, first set the password, and you will be prompted to enter the password Enter current password for root (enter for none):
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: 221
*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.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.