Linux系统之安装mariadb方法

本文涉及的产品
云数据库 RDS MySQL,集群系列 2核4GB
推荐场景:
搭建个人博客
RDS MySQL Serverless 基础系列,0.5-2RCU 50GB
RDS MySQL Serverless 高可用系列,价值2615元额度,1个月
简介: Linux系统之安装mariadb方法

一、检查系统版本

[root@serer01 ~]# cat /etc/os-release 
NAME="CentOS Linux"
VERSION="7 (Core)"
ID="centos"
ID_LIKE="rhel fedora"
VERSION_ID="7"
PRETTY_NAME="CentOS Linux 7 (Core)"
ANSI_COLOR="0;31"
CPE_NAME="cpe:/o:centos:centos:7"
HOME_URL="https://www.centos.org/"
BUG_REPORT_URL="https://bugs.centos.org/"

CENTOS_MANTISBT_PROJECT="CentOS-7"
CENTOS_MANTISBT_PROJECT_VERSION="7"
REDHAT_SUPPORT_PRODUCT="centos"
REDHAT_SUPPORT_PRODUCT_VERSION="7"

二、配置mariadb的yum源

1.配置yum源

[root@serer01 ~]# cat /etc/yum.repos.d/mariadb.repo
# MariaDB 10.6 CentOS repository list - created 2021-12-27 11:21 UTC
# https://mariadb.org/download/
[mariadb]
name = MariaDB
baseurl = https://mirrors.xtom.com.hk/mariadb/yum/10.6/centos7-amd64
gpgkey=https://mirrors.xtom.com.hk/mariadb/yum/RPM-GPG-KEY-MariaDB
gpgcheck=0
enable=1

2.替换中科大的源

 sed -i 's#//mirrors.xtom.com.hk#//mirrors.ustc.edu.cn#g' /etc/yum.repos.d/mariadb.repo

三、检查yum仓库

1.修改/etc/yum.conf文件

[root@serer01 ~]# grep false /etc/yum.conf 
sslverify=false

2.检查yum仓库

[root@serer01 ~]# yum repolist all |grep enable
base/7/x86_64                        CentOS-7 - Base - mirrors.a enabled: 10,072
docker-ce-stable/7/x86_64            Docker CE Stable - x86_64   enabled:    183
extras/7/x86_64                      CentOS-7 - Extras - mirrors enabled:    515
mariadb                              MariaDB                     enabled:     95
updates/7/x86_64                     CentOS-7 - Updates - mirror enabled:  4,346

四、安装mariadb

[root@serer01 ~]# yum -y install Mariadb-server
Loaded plugins: fastestmirror
Loading mirror speeds from cached hostfile
 * base: mirrors.aliyun.com
 * extras: mirrors.aliyun.com
 * updates: mirrors.aliyun.com
No package Mariadb-server available.
  * Maybe you meant: MariaDB-server, mariadb-server
Error: Nothing to do
[root@serer01 ~]# yum -y install Mariadb-server  --nodeps
Loaded plugins: fastestmirror
Loading mirror speeds from cached hostfile
 * base: mirrors.aliyun.com
 * extras: mirrors.aliyun.com
 * updates: mirrors.aliyun.com
No package Mariadb-server available.
  * Maybe you meant: MariaDB-server, mariadb-server
Error: Nothing to do
[root@serer01 ~]# yum -y install  MariaDB-server
Loaded plugins: fastestmirror
Loading mirror speeds from cached hostfile
 * base: mirrors.aliyun.com
 * extras: mirrors.aliyun.com
 * updates: mirrors.aliyun.com
Resolving Dependencies
--> Running transaction check
---> Package MariaDB-server.x86_64 0:10.6.10-1.el7.centos will be installed
--> Processing Dependency: MariaDB-common >= 10.6.1 for package: MariaDB-server-10.6.10-1.el7.centos.x86_64
--> Processing Dependency: MariaDB-client >= 10.6.1 for package: MariaDB-server-10.6.10-1.el7.centos.x86_64
--> Processing Dependency: libpmem.so.1(LIBPMEM_1.0)(64bit) for package: MariaDB-server-10.6.10-1.el7.centos.x86_64
--> Processing Dependency: rsync for package: MariaDB-server-10.6.10-1.el7.centos.x86_64
--> Processing Dependency: galera-4 for package: MariaDB-server-10.6.10-1.el7.centos.x86_64
--> Processing Dependency: libcrypto.so.10(OPENSSL_1.0.2)(64bit) for package: MariaDB-server-10.6.10-1.el7.centos.x86_64
--> Processing Dependency: lsof for package: MariaDB-server-10.6.10-1.el7.centos.x86_64
--> Processing Dependency: libpmem.so.1()(64bit) for package: MariaDB-server-10.6.10-1.el7.centos.x86_64
--> Processing Dependency: libpcre2-8.so.0()(64bit) for package: MariaDB-server-10.6.10-1.el7.centos.x86_64
--> Running transaction check
---> Package MariaDB-client.x86_64 0:10.6.10-1.el7.centos will be installed
--> Processing Dependency: perl(DBI) for package: MariaDB-client-10.6.10-1.el7.centos.x86_64
--> Processing Dependency: perl(Data::Dumper) for package: MariaDB-client-10.6.10-1.el7.centos.x86_64
---> Package MariaDB-common.x86_64 0:10.6.10-1.el7.centos will be installed
--> Processing Dependency: MariaDB-compat for package: MariaDB-common-10.6.10-1.el7.centos.x86_64
---> Package galera-4.x86_64 0:26.4.12-1.el7.centos will be installed
--> Processing Dependency: socat for package: galera-4-26.4.12-1.el7.centos.x86_64
--> Processing Dependency: libboost_program_options-mt.so.1.53.0()(64bit) for package: galera-4-26.4.12-1.el7.centos.x86_64
---> Package libpmem.x86_64 0:1.5.1-2.1.el7 will be installed
---> Package lsof.x86_64 0:4.87-6.el7 will be installed
---> Package openssl-libs.x86_64 1:1.0.1e-42.el7.9 will be updated
--> Processing Dependency: openssl-libs(x86-64) = 1:1.0.1e-42.el7.9 for package: 1:openssl-1.0.1e-42.el7.9.x86_64
---> Package openssl-libs.x86_64 1:1.0.2k-25.el7_9 will be an update
---> Package pcre2.x86_64 0:10.23-2.el7 will be installed
---> Package rsync.x86_64 0:3.1.2-11.el7_9 will be installed
--> Running transaction check
---> Package MariaDB-compat.x86_64 0:10.6.10-1.el7.centos will be obsoleting
---> Package boost-program-options.x86_64 0:1.53.0-28.el7 will be installed
---> Package mariadb-libs.x86_64 1:5.5.44-2.el7.centos will be obsoleted
---> Package openssl.x86_64 1:1.0.1e-42.el7.9 will be updated
---> Package openssl.x86_64 1:1.0.2k-25.el7_9 will be an update
---> Package perl-DBI.x86_64 0:1.627-4.el7 will be installed
--> Processing Dependency: perl(RPC::PlServer) >= 0.2001 for package: perl-DBI-1.627-4.el7.x86_64
--> Processing Dependency: perl(RPC::PlClient) >= 0.2000 for package: perl-DBI-1.627-4.el7.x86_64
---> Package perl-Data-Dumper.x86_64 0:2.145-3.el7 will be installed
---> Package socat.x86_64 0:1.7.3.2-2.el7 will be installed
--> Running transaction check
---> Package perl-PlRPC.noarch 0:0.2020-14.el7 will be installed
--> Processing Dependency: perl(Net::Daemon) >= 0.13 for package: perl-PlRPC-0.2020-14.el7.noarch
--> Processing Dependency: perl(Net::Daemon::Test) for package: perl-PlRPC-0.2020-14.el7.noarch
--> Processing Dependency: perl(Net::Daemon::Log) for package: perl-PlRPC-0.2020-14.el7.noarch
--> Processing Dependency: perl(Compress::Zlib) for package: perl-PlRPC-0.2020-14.el7.noarch
--> Running transaction check
---> Package perl-IO-Compress.noarch 0:2.061-2.el7 will be installed
--> Processing Dependency: perl(Compress::Raw::Zlib) >= 2.061 for package: perl-IO-Compress-2.061-2.el7.noarch
--> Processing Dependency: perl(Compress::Raw::Bzip2) >= 2.061 for package: perl-IO-Compress-2.061-2.el7.noarch
---> Package perl-Net-Daemon.noarch 0:0.48-5.el7 will be installed
--> Running transaction check
---> Package perl-Compress-Raw-Bzip2.x86_64 0:2.061-3.el7 will be installed
---> Package perl-Compress-Raw-Zlib.x86_64 1:2.061-4.el7 will be installed
--> Finished Dependency Resolution

Dependencies Resolved

===================================================================================================================================================
 Package                                     Arch                       Version                                  Repository                   Size
===================================================================================================================================================
Installing:
 MariaDB-compat                              x86_64                     10.6.10-1.el7.centos                     mariadb                     2.2 M
     replacing  mariadb-libs.x86_64 1:5.5.44-2.el7.centos
 MariaDB-server                              x86_64                     10.6.10-1.el7.centos                     mariadb                      25 M
Installing for dependencies:
 MariaDB-client                              x86_64                     10.6.10-1.el7.centos                     mariadb                      14 M
 MariaDB-common                              x86_64                     10.6.10-1.el7.centos                     mariadb                      81 k
 boost-program-options                       x86_64                     1.53.0-28.el7                            base                        156 k
 galera-4                                    x86_64                     26.4.12-1.el7.centos                     mariadb                     9.9 M
 libpmem                                     x86_64                     1.5.1-2.1.el7                            base                         59 k
 lsof                                        x86_64                     4.87-6.el7                               base                        331 k
 pcre2                                       x86_64                     10.23-2.el7                              base                        201 k
 perl-Compress-Raw-Bzip2                     x86_64                     2.061-3.el7                              base                         32 k
 perl-Compress-Raw-Zlib                      x86_64                     1:2.061-4.el7                            base                         57 k
 perl-DBI                                    x86_64                     1.627-4.el7                              base                        802 k
 perl-Data-Dumper                            x86_64                     2.145-3.el7                              base                         47 k
 perl-IO-Compress                            noarch                     2.061-2.el7                              base                        260 k
 perl-Net-Daemon                             noarch                     0.48-5.el7                               base                         51 k
 perl-PlRPC                                  noarch                     0.2020-14.el7                            base                         36 k
 rsync                                       x86_64                     3.1.2-11.el7_9                           updates                     408 k
 socat                                       x86_64                     1.7.3.2-2.el7                            base                        290 k
Updating for dependencies:
 openssl                                     x86_64                     1:1.0.2k-25.el7_9                        updates                     494 k
 openssl-libs                                x86_64                     1:1.0.2k-25.el7_9                        updates                     1.2 M

Transaction Summary
===================================================================================================================================================
Install  2 Packages (+16 Dependent packages)
Upgrade             (  2 Dependent packages)

Total download size: 56 M
Downloading packages:
Delta RPMs disabled because /usr/bin/applydeltarpm not installed.
(1/20): MariaDB-common-10.6.10-1.el7.centos.x86_64.rpm                                                                      |  81 kB  00:00:00     
(2/20): MariaDB-compat-10.6.10-1.el7.centos.x86_64.rpm                                                                      | 2.2 MB  00:00:00     
(3/20): MariaDB-client-10.6.10-1.el7.centos.x86_64.rpm                                                                      |  14 MB  00:00:01     
(4/20): boost-program-options-1.53.0-28.el7.x86_64.rpm                                                                      | 156 kB  00:00:00     
(5/20): libpmem-1.5.1-2.1.el7.x86_64.rpm                                                                                    |  59 kB  00:00:00     
(6/20): openssl-1.0.2k-25.el7_9.x86_64.rpm                                                                                  | 494 kB  00:00:00     
(7/20): pcre2-10.23-2.el7.x86_64.rpm                                                                                        | 201 kB  00:00:00     
(8/20): perl-Compress-Raw-Bzip2-2.061-3.el7.x86_64.rpm                                                                      |  32 kB  00:00:00     
(9/20): perl-Compress-Raw-Zlib-2.061-4.el7.x86_64.rpm                                                                       |  57 kB  00:00:00     
(10/20): openssl-libs-1.0.2k-25.el7_9.x86_64.rpm                                                                            | 1.2 MB  00:00:00     
(11/20): perl-DBI-1.627-4.el7.x86_64.rpm                                                                                    | 802 kB  00:00:00     
(12/20): perl-Data-Dumper-2.145-3.el7.x86_64.rpm                                                                            |  47 kB  00:00:00     
(13/20): perl-IO-Compress-2.061-2.el7.noarch.rpm                                                                            | 260 kB  00:00:00     
(14/20): perl-Net-Daemon-0.48-5.el7.noarch.rpm                                                                              |  51 kB  00:00:00     
(15/20): perl-PlRPC-0.2020-14.el7.noarch.rpm                                                                                |  36 kB  00:00:00     
(16/20): socat-1.7.3.2-2.el7.x86_64.rpm                                                                                     | 290 kB  00:00:00     
(17/20): lsof-4.87-6.el7.x86_64.rpm                                                                                         | 331 kB  00:00:00     
(18/20): rsync-3.1.2-11.el7_9.x86_64.rpm                                                                                    | 408 kB  00:00:00     
(19/20): MariaDB-server-10.6.10-1.el7.centos.x86_64.rpm                                                                     |  25 MB  00:00:02     
(20/20): galera-4-26.4.12-1.el7.centos.x86_64.rpm                                                                           | 9.9 MB  00:00:01     
---------------------------------------------------------------------------------------------------------------------------------------------------
Total                                                                                                               19 MB/s |  56 MB  00:00:02     
Running transaction check
Running transaction test
Transaction test succeeded
Running transaction
  Updating   : 1:openssl-libs-1.0.2k-25.el7_9.x86_64                                                                                          1/23 
  Installing : pcre2-10.23-2.el7.x86_64                                                                                                       2/23 
  Installing : libpmem-1.5.1-2.1.el7.x86_64                                                                                                   3/23 
  Installing : perl-Data-Dumper-2.145-3.el7.x86_64                                                                                            4/23 
  Installing : rsync-3.1.2-11.el7_9.x86_64                                                                                                    5/23 
  Installing : lsof-4.87-6.el7.x86_64                                                                                                         6/23 
  Updating   : 1:openssl-1.0.2k-25.el7_9.x86_64                                                                                               7/23 
  Installing : MariaDB-common-10.6.10-1.el7.centos.x86_64                                                                                     8/23 
  Installing : MariaDB-compat-10.6.10-1.el7.centos.x86_64                                                                                     9/23 
  Installing : socat-1.7.3.2-2.el7.x86_64                                                                                                    10/23 
  Installing : perl-Net-Daemon-0.48-5.el7.noarch                                                                                             11/23 
  Installing : 1:perl-Compress-Raw-Zlib-2.061-4.el7.x86_64                                                                                   12/23 
  Installing : perl-Compress-Raw-Bzip2-2.061-3.el7.x86_64                                                                                    13/23 
  Installing : perl-IO-Compress-2.061-2.el7.noarch                                                                                           14/23 
  Installing : perl-PlRPC-0.2020-14.el7.noarch                                                                                               15/23 
  Installing : perl-DBI-1.627-4.el7.x86_64                                                                                                   16/23 
  Installing : MariaDB-client-10.6.10-1.el7.centos.x86_64                                                                                    17/23 
  Installing : boost-program-options-1.53.0-28.el7.x86_64                                                                                    18/23 
  Installing : galera-4-26.4.12-1.el7.centos.x86_64                                                                                          19/23 
  Installing : MariaDB-server-10.6.10-1.el7.centos.x86_64                                                                                    20/23 


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 https://mariadb.com/kb

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

The latest information about MariaDB is available at https://mariadb.org/.

Consider joining MariaDB's strong and vibrant community:
https://mariadb.org/get-involved/

  Erasing    : 1:mariadb-libs-5.5.44-2.el7.centos.x86_64                                                                                     21/23 
  Cleanup    : 1:openssl-1.0.1e-42.el7.9.x86_64                                                                                              22/23 
  Cleanup    : 1:openssl-libs-1.0.1e-42.el7.9.x86_64                                                                                         23/23 
  Verifying  : boost-program-options-1.53.0-28.el7.x86_64                                                                                     1/23 
  Verifying  : 1:openssl-1.0.2k-25.el7_9.x86_64                                                                                               2/23 
  Verifying  : lsof-4.87-6.el7.x86_64                                                                                                         3/23 
  Verifying  : MariaDB-server-10.6.10-1.el7.centos.x86_64                                                                                     4/23 
  Verifying  : perl-Compress-Raw-Bzip2-2.061-3.el7.x86_64                                                                                     5/23 
  Verifying  : rsync-3.1.2-11.el7_9.x86_64                                                                                                    6/23 
  Verifying  : MariaDB-compat-10.6.10-1.el7.centos.x86_64                                                                                     7/23 
  Verifying  : MariaDB-client-10.6.10-1.el7.centos.x86_64                                                                                     8/23 
  Verifying  : perl-Data-Dumper-2.145-3.el7.x86_64                                                                                            9/23 
  Verifying  : perl-DBI-1.627-4.el7.x86_64                                                                                                   10/23 
  Verifying  : libpmem-1.5.1-2.1.el7.x86_64                                                                                                  11/23 
  Verifying  : pcre2-10.23-2.el7.x86_64                                                                                                      12/23 
  Verifying  : galera-4-26.4.12-1.el7.centos.x86_64                                                                                          13/23 
  Verifying  : 1:openssl-libs-1.0.2k-25.el7_9.x86_64                                                                                         14/23 
  Verifying  : 1:perl-Compress-Raw-Zlib-2.061-4.el7.x86_64                                                                                   15/23 
  Verifying  : perl-Net-Daemon-0.48-5.el7.noarch                                                                                             16/23 
  Verifying  : perl-IO-Compress-2.061-2.el7.noarch                                                                                           17/23 
  Verifying  : perl-PlRPC-0.2020-14.el7.noarch                                                                                               18/23 
  Verifying  : MariaDB-common-10.6.10-1.el7.centos.x86_64                                                                                    19/23 
  Verifying  : socat-1.7.3.2-2.el7.x86_64                                                                                                    20/23 
  Verifying  : 1:mariadb-libs-5.5.44-2.el7.centos.x86_64                                                                                     21/23 
  Verifying  : 1:openssl-libs-1.0.1e-42.el7.9.x86_64                                                                                         22/23 
  Verifying  : 1:openssl-1.0.1e-42.el7.9.x86_64                                                                                              23/23 

Installed:
  MariaDB-compat.x86_64 0:10.6.10-1.el7.centos                             MariaDB-server.x86_64 0:10.6.10-1.el7.centos                            

Dependency Installed:
  MariaDB-client.x86_64 0:10.6.10-1.el7.centos    MariaDB-common.x86_64 0:10.6.10-1.el7.centos    boost-program-options.x86_64 0:1.53.0-28.el7   
  galera-4.x86_64 0:26.4.12-1.el7.centos          libpmem.x86_64 0:1.5.1-2.1.el7                  lsof.x86_64 0:4.87-6.el7                       
  pcre2.x86_64 0:10.23-2.el7                      perl-Compress-Raw-Bzip2.x86_64 0:2.061-3.el7    perl-Compress-Raw-Zlib.x86_64 1:2.061-4.el7    
  perl-DBI.x86_64 0:1.627-4.el7                   perl-Data-Dumper.x86_64 0:2.145-3.el7           perl-IO-Compress.noarch 0:2.061-2.el7          
  perl-Net-Daemon.noarch 0:0.48-5.el7             perl-PlRPC.noarch 0:0.2020-14.el7               rsync.x86_64 0:3.1.2-11.el7_9                  
  socat.x86_64 0:1.7.3.2-2.el7                   

Dependency Updated:
  openssl.x86_64 1:1.0.2k-25.el7_9                                      openssl-libs.x86_64 1:1.0.2k-25.el7_9                                     

Replaced:
  mariadb-libs.x86_64 1:5.5.44-2.el7.centos                                                                                                        

Complete!

五、启动mariadb服务

1.启动mariadb服务

[root@serer01 ~]# systemctl enable --now mariadb
Created symlink from /etc/systemd/system/multi-user.target.wants/mariadb.service to /usr/lib/systemd/system/mariadb.service.

2.查看mariadb服务状态

[root@serer01 ~]# systemctl status mariadb
● mariadb.service - MariaDB 10.6.10 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 2022-11-04 22:50:42 CST; 38s ago
     Docs: man:mariadbd(8)
           https://mariadb.com/kb/en/library/systemd/
  Process: 13728 ExecStartPost=/bin/sh -c systemctl unset-environment _WSREP_START_POSITION (code=exited, status=0/SUCCESS)
  Process: 13702 ExecStartPre=/bin/sh -c [ ! -e /usr/bin/galera_recovery ] && VAR= ||   VAR=`cd /usr/bin/..; /usr/bin/galera_recovery`; [ $? -eq 0 ]   && systemctl set-environment _WSREP_START_POSITION=$VAR || exit 1 (code=exited, status=0/SUCCESS)
  Process: 13700 ExecStartPre=/bin/sh -c systemctl unset-environment _WSREP_START_POSITION (code=exited, status=0/SUCCESS)
 Main PID: 13714 (mariadbd)
   Status: "Taking your SQL requests now..."
   Memory: 61.3M
   CGroup: /system.slice/mariadb.service
           └─13714 /usr/sbin/mariadbd

Nov 04 22:50:42 serer01 mariadbd[13714]: 2022-11-04 22:50:42 0 [Note] InnoDB: File './ibtmp1' size is now 12 MB.
Nov 04 22:50:42 serer01 mariadbd[13714]: 2022-11-04 22:50:42 0 [Note] InnoDB: 10.6.10 started; log sequence number 42132; transaction id 14
Nov 04 22:50:42 serer01 mariadbd[13714]: 2022-11-04 22:50:42 0 [Note] Plugin 'FEEDBACK' is disabled.
Nov 04 22:50:42 serer01 mariadbd[13714]: 2022-11-04 22:50:42 0 [Note] InnoDB: Loading buffer pool(s) from /var/lib/mysql/ib_buffer_pool
Nov 04 22:50:42 serer01 mariadbd[13714]: 2022-11-04 22:50:42 0 [Note] InnoDB: Buffer pool(s) load completed at 221104 22:50:42
Nov 04 22:50:42 serer01 mariadbd[13714]: 2022-11-04 22:50:42 0 [Note] Server socket created on IP: '0.0.0.0'.
Nov 04 22:50:42 serer01 mariadbd[13714]: 2022-11-04 22:50:42 0 [Note] Server socket created on IP: '::'.
Nov 04 22:50:42 serer01 mariadbd[13714]: 2022-11-04 22:50:42 0 [Note] /usr/sbin/mariadbd: ready for connections.
Nov 04 22:50:42 serer01 mariadbd[13714]: Version: '10.6.10-MariaDB'  socket: '/var/lib/mysql/mysql.sock'  port: 3306  MariaDB Server
Nov 04 22:50:42 serer01 systemd[1]: Started MariaDB 10.6.10 database server.

六、mariadb的远程连接

1.本地连接

[root@serer01 ~]# mysql
Welcome to the MariaDB monitor.  Commands end with ; or \g.
Your MariaDB connection id is 3
Server version: 10.6.10-MariaDB MariaDB Server

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

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

MariaDB [(none)]> show databases;
+--------------------+
| Database           |
+--------------------+
| information_schema |
| mysql              |
| performance_schema |
| sys                |
| test               |
+--------------------+
5 rows in set (0.002 sec)

MariaDB [(none)]> 

2.创建用户

MariaDB [(none)]> CREATE USER 'admin'@'%' IDENTIFIED BY 'admin123456';
Query OK, 0 rows affected (0.021 sec)

MariaDB [(none)]> 

3.对用户授权

MariaDB [(none)]>  grant all on *.* to 'admin'@'%' with grant option;
Query OK, 0 rows affected (0.020 sec)

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

MariaDB [(none)]> 

4.测试远程连接mariadb数据库

[root@serer01 ~]# mysql -h 192.168.3.169 -P3306 -uadmin -padmin123456
Welcome to the MariaDB monitor.  Commands end with ; or \g.
Your MariaDB connection id is 5
Server version: 10.6.10-MariaDB MariaDB Server

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

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

MariaDB [(none)]> 
相关实践学习
如何快速连接云数据库RDS MySQL
本场景介绍如何通过阿里云数据管理服务DMS快速连接云数据库RDS MySQL,然后进行数据表的CRUD操作。
全面了解阿里云能为你做什么
阿里云在全球各地部署高效节能的绿色数据中心,利用清洁计算为万物互联的新世界提供源源不断的能源动力,目前开服的区域包括中国(华北、华东、华南、香港)、新加坡、美国(美东、美西)、欧洲、中东、澳大利亚、日本。目前阿里云的产品涵盖弹性计算、数据库、存储与CDN、分析与搜索、云通信、网络、管理与监控、应用服务、互联网中间件、移动服务、视频服务等。通过本课程,来了解阿里云能够为你的业务带来哪些帮助     相关的阿里云产品:云服务器ECS 云服务器 ECS(Elastic Compute Service)是一种弹性可伸缩的计算服务,助您降低 IT 成本,提升运维效率,使您更专注于核心业务创新。产品详情: https://www.aliyun.com/product/ecs
相关文章
|
2天前
|
存储 IDE Linux
零基础保姆级教程!手把手教你免费玩转Linux CentOS安装+学习环境搭建(附避坑指南)
本文详细介绍了在VMware虚拟机中安装CentOS 6.8的全过程。首先,需确保已安装VMware并开启V-CPU虚拟化功能,可通过BIOS设置或使用LeoMoon CPU-V工具检测。接着,下载CentOS镜像文件,并在VMware中新建虚拟机,配置CPU、内存、硬盘等参数。最后,加载ISO镜像启动虚拟机,按照提示完成CentOS的安装,包括语言、键盘、存储方式、地区、密码设置及硬盘分区等步骤。安装完成后,以root用户登录即可进入系统桌面,开始学习Linux命令和操作。
39 12
零基础保姆级教程!手把手教你免费玩转Linux CentOS安装+学习环境搭建(附避坑指南)
|
15天前
|
缓存 Ubuntu Linux
Linux中yum、rpm、apt-get、wget的区别,yum、rpm、apt-get常用命令,CentOS、Ubuntu中安装wget
通过本文,我们详细了解了 `yum`、`rpm`、`apt-get`和 `wget`的区别、常用命令以及在CentOS和Ubuntu中安装 `wget`的方法。`yum`和 `apt-get`是高层次的包管理器,分别用于RPM系和Debian系发行版,能够自动解决依赖问题;而 `rpm`是低层次的包管理工具,适合处理单个包;`wget`则是一个功能强大的下载工具,适用于各种下载任务。在实际使用中,根据系统类型和任务需求选择合适的工具,可以大大提高工作效率和系统管理的便利性。
97 25
|
1月前
|
Linux
Linux系统之whereis命令的基本使用
Linux系统之whereis命令的基本使用
73 24
Linux系统之whereis命令的基本使用
|
1月前
|
Ubuntu Java Linux
Linux 安装 Qualcomm ® SnapdragonTM Profiler
通过本文的详细介绍,您应该已经成功在 Linux 系统上安装并配置了 Qualcomm® Snapdragon™ Profiler,并能够连接 Android 设备进行性能分析。Snapdragon Profiler 提供了丰富的工具和功能,可以帮助开发者深入了解应用程序的性能瓶颈,从而进行优化。希望本文能对您有所帮助,让您在开发过程中更高效地使用 Snapdragon Profiler 进行性能分析和优化。
71 10
|
1月前
|
Linux
Linux安装svn并启动
Linux安装svn并启动
59 10
|
2月前
|
弹性计算 运维 Ubuntu
os-copilot在Alibaba Cloud Linux镜像下的安装与功能测试
我顺利使用了OS Copilot的 -t -f 功能,我的疑惑是在换行的时候就直接进行提问了,每次只能写一个问题,没法连续换行更有逻辑的输入问题。 我认为 -t 管道 功能有用 ,能解决环境问题的连续性操作。 我认为 -f 管道 功能有用 ,可以单独创建可连续性提问的task问题。 我认为 | 对文件直接理解在新的服务器理解有很大的帮助。 此外,我还有建议 可以在非 co 的环境下也能进行连续性的提问。
87 7
|
2月前
|
缓存 安全 Linux
Linux系统查看操作系统版本信息、CPU信息、模块信息
在Linux系统中,常用命令可帮助用户查看操作系统版本、CPU信息和模块信息
153 23
|
2月前
|
Oracle 关系型数据库 Linux
linux8安装oracle 11g遇到的问题记录
Oracle 11g在Linux 8上安装时会遇到link编译环节的问题。官方建议忽略安装中的链接错误,安装完成后应用DBPSU 11.2.0.4.240716补丁及一次性补丁33991024,再重新编译二进制文件,并配置监听器和数据库。但因11g已退出服务期,这些补丁需付费获取。网上信息显示22年1月的PSU补丁也可解决问题,找到该补丁后按常规方式打补丁即可。如有需求或疑问可咨询我。
90 20
|
3月前
|
NoSQL 关系型数据库 MySQL
Linux安装jdk、mysql、redis
Linux安装jdk、mysql、redis
254 7
|
3月前
|
Linux Python
Linux 安装python3.7.6
本教程介绍在Linux系统上安装Python 3.7.6的步骤。首先使用`yum`安装依赖环境,包括zlib、openssl等开发库。接着通过`wget`下载Python 3.7.6源码包并解压。创建目标文件夹`/usr/local/python3`后,进入解压目录执行配置、编译和安装命令。最后设置软链接,使`python3`和`pip3`命令生效。