CentOS7는 MariaDB를 설치

설치

  • 설치 온라인 (느린 죽음)
  • RPM 오프라인 설치 (CentOS7.X)

온라인 설치

  1. 열기 공식 웹 사이트 https://mariadb.org/
    그림 1
  2. 클릭하여 다운로드를 , 다음 페이지로 이동
    그림 2
  3. 계속 클릭 하여 다운로드를 , 다음 페이지로 이동
    그림 3
  4. 빨간색 상자를 클릭 [링크] (https://downloads.mariadb.org/mariadb/repositories/#mirror=23Media), 페이지 들여다
    그림 4
  5. 설치하려는 버전을 선택하는 데이터베이스 서버의 유형 / 버전에 따라.
    온라인으로 설치할 수 있습니다 위의 단계를 따릅니다.

오프라인 설치

  1. 그림 4에서 클릭 base을
    그림 5
  2. 클릭 RPMS를 , 당신은 걱정 다음 단계를보고 계속하지 마십시오 rpm 패키지의 무리를 볼 수 있습니다
    6
  3. 打开MariaDB 조직 -> 알아보기 -> [ MariaDB 기술 자료 ] -> MariaDB 서버 ->

    Getting, Installing, and Upgrading MariaDB --> MariaDB Binary Packages --> Installing MariaDB RPM Files --> MariaDB Installation (Version 10.1.21) via RPMs on CentOS 7

    最终的url点击之后,就可以看到如下图所示界面:
    그림 7
    本来完全可以提供最终的一个url,提供一步一步点击的按钮连接,是为了方便大家来学习路线思路,而不能只拿结果。
  4. 还记得我们之前第二步看到的一堆rpm包吗? 下载第三步方框中的package,当然,这个文档的版本稍有点落后,但是我们只需要搜索前缀名称就行了,比如搜索client:
    그림 8
    我们下载最新版本就可以了。
    接下来进入正式步骤了哦~:
    在图7中有Step by step installation:

Step by step installation:

  • 1) First install all of the dependencies needed. Its easy to do this via YUM packages: yum install rsync nmap lsof perl-DBI nc
  • 2) rpm -ivh jemalloc-3.6.0-1.el7.x86_64.rpm
  • 3) rpm -ivh jemalloc-devel-3.6.0-1.el7.x86_64.rpm
  • 4) RPM -ivh MariaDB-10.1.21-centos7-x86_64에-common.rpm MariaDB-10.1.21-centos7-x86_64에-compat.rpm MariaDB-10.1.21-centos7-x86_64에-client.rpm의 갈레-25.3.19- 1.rhel7.el7.centos.x86_64.rpm MariaDB - 10.1.21 - centos7-x86_64의-server.rpm

우리는 시작의 단계에 따라 :

  1. 설치 종속성 정보, 명령 행 :

    [root@iZ2ze7s2v0b78922wia32rZ software]#  yum install rsync nmap lsof perl-DBI nc
  2. 우리는 다운로드 버전을 설치하기 전에jemalloc-3.6.0-1.el7.x86_64.rpm

    [root@iZ2ze7s2v0b78922wia32rZ mariadb]# rpm -ivh jemalloc-3.6.0-1.el7.x86_64.rpm 
  3. 설치jemalloc-devel-3.6.0-1.el7.x86_64.rpm

    [root@iZ2ze7s2v0b78922wia32rZ mariadb]# rpm -ivh jemalloc-devel-3.6.0-1.el7.x86_64.rpm
  4. 순서에주의를 지불해야 나머지 mariadb 관련 패키지를 설치합니다.common > compat > client > galera > server

    [root@iZ2ze7s2v0b78922wia32rZ mariadb]# rpm -ivh MariaDB-common-10.4.8-1.el7.centos.x86_64.rpm MariaDB-compat-10.4.8-1.el7.centos.x86_64.rpm MariaDB-client-10.4.8-1.el7.centos.x86_64.rpm galera-4-26.4.3-1.rhel7.el7.centos.x86_64.rpm MariaDB-server-10.4.8-1.el7.centos.x86_64.rpm 
    warning: MariaDB-common-10.4.8-1.el7.centos.x86_64.rpm: Header V4 DSA/SHA1 Signature, key ID 1bb943db: NOKEY
    error: Failed dependencies:
            mariadb-libs < 1:10.1.0 conflicts with MariaDB-compat-10.4.8-1.el7.centos.x86_64
            mariadb-libs is obsoleted by MariaDB-compat-10.4.8-1.el7.centos.x86_64
            libaio.so.1()(64bit) is needed by MariaDB-client-10.4.8-1.el7.centos.x86_64
            libaio.so.1(LIBAIO_0.1)(64bit) is needed by MariaDB-client-10.4.8-1.el7.centos.x86_64
            libaio.so.1(LIBAIO_0.4)(64bit) is needed by MariaDB-client-10.4.8-1.el7.centos.x86_64
            libboost_program_options.so.1.53.0()(64bit) is needed by galera-4-26.4.3-1.rhel7.el7.centos.x86_64
            libaio.so.1()(64bit) is needed by MariaDB-server-10.4.8-1.el7.centos.x86_64
            libaio.so.1(LIBAIO_0.1)(64bit) is needed by MariaDB-server-10.4.8-1.el7.centos.x86_64
            libaio.so.1(LIBAIO_0.4)(64bit) is needed by MariaDB-server-10.4.8-1.el7.centos.x86_64

    그림 7에서 페이지를 발견 오류를 수행하거나 표시 후, 우리는 것을 알 수 있습니다 Step by step installation:단락의 종료 후 같은 문장이있다 :Here is the error message for dependencies:

    # rpm -ivh MariaDB-10.1.21-centos7-x86_64-common.rpm 
    warning: MariaDB-10.1.21-centos7-x86_64-common.rpm: Header V4 DSA/SHA1 Signature, key ID 1bb943db: NOKEY
    error: Failed dependencies:
       mariadb-libs < 1:10.1.21-1.el7.centos conflicts with MariaDB-common-10.1.21-1.el7.centos.x86_64

    우리의 잘못과 매우 유사 아닌가? 공식 솔루션에 따라 해결할 수 있습니다.

    여러 후속 오류가 공식 프로세스에 의해 주어진 동일한 솔루션에 따라도있다 다음과 같이 단계별로는 얻을 수 있습니다 :

    [root@iZ2ze7s2v0b78922wia32rZ mariadb]# rpm -qa | grep mariadb-libs
    mariadb-libs-5.5.60-1.el7_5.x86_64
    [root@iZ2ze7s2v0b78922wia32rZ mariadb]# rpm -ev --nodeps mariadb-libs-5.5.60-1.el7_5.x86_64
    Preparing packages...
    mariadb-libs-1:5.5.60-1.el7_5.x86_64
    [root@iZ2ze7s2v0b78922wia32rZ mariadb]# rpm -qa | grep mariadb-libs                        
    [root@iZ2ze7s2v0b78922wia32rZ mariadb]# yum install boost-devel.x86_64
    Loaded plugins: fastestmirror
    Loading mirror speeds from cached hostfile
    Resolving Dependencies
    --> Running transaction check
    ...
    Is this ok [y/d/N]: y
    ...
    
    Complete!
    [root@iZ2ze7s2v0b78922wia32rZ mariadb]# rpm --import http://yum.mariadb.org/RPM-GPG-KEY-MariaDB

    그런 다음 설치의 네 번째 단계로 백업 :

    [root@iZ2ze7s2v0b78922wia32rZ mariadb]# rpm -ivh MariaDB-common-10.4.8-1.el7.centos.x86_64.rpm MariaDB-compat-10.4.8-1.el7.centos.x86_64.rpm MariaDB-client-10.4.8-1.el7.centos.x86_64.rpm galera-4-26.4.3-1.rhel7.el7.centos.x86_64.rpm MariaDB-server-10.4.8-1.el7.centos.x86_64.rpm 
    error: Failed dependencies:
            libaio.so.1()(64bit) is needed by MariaDB-client-10.4.8-1.el7.centos.x86_64
            libaio.so.1(LIBAIO_0.1)(64bit) is needed by MariaDB-client-10.4.8-1.el7.centos.x86_64
            libaio.so.1(LIBAIO_0.4)(64bit) is needed by MariaDB-client-10.4.8-1.el7.centos.x86_64
            libaio.so.1()(64bit) is needed by MariaDB-server-10.4.8-1.el7.centos.x86_64
            libaio.so.1(LIBAIO_0.1)(64bit) is needed by MariaDB-server-10.4.8-1.el7.centos.x86_64
            libaio.so.1(LIBAIO_0.4)(64bit) is needed by MariaDB-server-10.4.8-1.el7.centos.x86_64

    조회 결과 또는 오류? ? ?

    joke1

    이에 공식이다 10.4.8종속 패키지를 다운로드 할 수있는 새로운, 필요의 도입에 질문 libaio:

    [root@iZ2ze7s2v0b78922wia32rZ mariadb]# wget http://mirror.centos.org/centos/6/os/x86_64/Packages/libaio-0.3.107-10.el6.x86_64.rpm
    --2019-11-28 10:52:26--  http://mirror.centos.org/centos/6/os/x86_64/Packages/libaio-0.3.107-10.el6.x86_64.rpm

    성공적으로 다운로드 한 후, 무엇을 현재 다운로드 종속성을 설치합니다 :

    [root@iZ2ze7s2v0b78922wia32rZ mariadb]# rpm -ivh libaio-0.3.107-10.el6.x86_64.rpm

그런 다음 다시 반복 Step 4:

[root@iZ2ze7s2v0b78922wia32rZ mariadb]# rpm -ivh MariaDB-common-10.4.8-1.el7.centos.x86_64.rpm MariaDB-compat-10.4.8-1.el7.centos.x86_64.rpm MariaDB-client-10.4.8-1.el7.centos.x86_64.rpm galera-4-26.4.3-1.rhel7.el7.centos.x86_64.rpm MariaDB-server-10.4.8-1.el7.centos.x86_64.rpm 
Preparing...                          ################################# [100%]
Updating / installing...
   1:MariaDB-compat-10.4.8-1.el7.cento################################# [ 20%]
   2:MariaDB-common-10.4.8-1.el7.cento################################# [ 40%]
   3:MariaDB-client-10.4.8-1.el7.cento################################# [ 60%]
   4:galera-4-26.4.3-1.rhel7.el7.cento################################# [ 80%]
   5:MariaDB-server-10.4.8-1.el7.cento################################# [100%]


Two all-privilege accounts were created.
One is root@localhost, it has no password, but you need to
be system 'root' user to connect. Use, for example, sudo mysql
The second is mysql@localhost, it has no password either, but
you need to be the system 'mysql' user to connect.
After connecting you can set the password, if you would need to be
able to connect as any of these users with a password and without sudo

See the MariaDB Knowledgebase at http://mariadb.com/kb or the
MySQL manual for more instructions.

Please report any problems at http://mariadb.org/jira

The latest information about MariaDB is available at http://mariadb.org/.
You can find additional information about the MySQL part at:
http://dev.mysql.com
Consider joining MariaDB's strong and vibrant community:
https://mariadb.org/get-involved/

마지막으로 성공적으로 설치. . .
joke2

다음, 구성 데이터베이스의 마지막 단계 :

# 启动mariaDB,(因为mariaDB是mysql作者写的新的数据库,其实服务和mysql是一样的,所以启动使用的是下面)
[root@iZ2ze7s2v0b78922wia32rZ ~]# service mysql start
# 安全配置
[root@iZ2ze7s2v0b78922wia32rZ ~]# mysql_secure_installation
# 输入root密码,安装后第一次启动为空,直接回车
Enter current password for root (enter for none): 
# step 1: 是否切换到unix_socket安全认证,否
Switch to unix_socket authentication [Y/n] n
# step 2: 更改密码,选择修改
Change the root password? [Y/n] y
# step 3: 移除匿名用户,选择是
Remove anonymous users? [Y/n] y
# step 4: 是否允许root远程登录,根据个人需求,因为我是测试服务器选择允许
Disallow root login remotely? [Y/n] y
# step 5: 移除test数据库
Remove test database and access to it? [Y/n] y
# step 6: 重新加载权限表
Reload privilege tables now? [Y/n] y
# 看到下面,说明成功啦!!!
All done!  If you've completed all of the above steps, your MariaDB
installation should now be secure.
Thanks for using MariaDB!

테스트

로그 데이터베이스 :

[root@iZ2ze7s2v0b78922wia32rZ ~]# mysql -u root -p

루트 원격 접속 권한 변경

MariaDB [(none)]> grant all privileges on *.* to 'root'@'%' identified by 'your password';
Query OK, 0 rows affected (0.001 sec)

MariaDB [(none)]> flush privileges;
Query OK, 0 rows affected (0.000 sec)

클라이언트 원격 연결

성공의 원격 접속도

추천

출처www.cnblogs.com/zhangpan1244/p/11955798.html