github.com/alibaba/sealer@v0.8.6-0.20220430115802-37a2bdaa8173/applications/mysql-operator/README.md (about)

     1  # Access the cluster
     2  
     3  Get root passwd:
     4  
     5  ```
     6  [root@iZ2zeaxzynknewlf0dkin9Z ~]# kubectl get secret cluster1-secrets -oyaml
     7  apiVersion: v1
     8  data:
     9  ...
    10    root: TGlaUXlqbDQzbXNnVnRVeFQ=
    11  ...
    12  kind: Secret
    13  ```
    14  
    15  ```
    16  echo 'TGlaUXlqbDQzbXNnVnRVeFQ='|base64 -d
    17  ```
    18  
    19  Get mysql host:
    20  
    21  ```
    22  [root@iZ2zeaxzynknewlf0dkin9Z ~]# kubectl get svc
    23  NAME                              TYPE        CLUSTER-IP      EXTERNAL-IP   PORT(S)                                 AGE
    24  cluster1-haproxy                  ClusterIP   10.98.98.110    <none>        3306/TCP,3309/TCP,33062/TCP,33060/TCP   53m
    25  cluster1-haproxy-replicas         ClusterIP   10.97.32.44     <none>        3306/TCP                                53m
    26  ```
    27  
    28  ```
    29  mysql -h 10.97.32.44 -p
    30  Enter password:
    31  Welcome to the MariaDB monitor.  Commands end with ; or \g.
    32  Your MySQL connection id is 3424
    33  Server version: 8.0.23-14.1 Percona XtraDB Cluster (GPL), Release rel14, Revision d3b9a1d, WSREP version 26.4.3
    34  
    35  Copyright (c) 2000, 2018, Oracle, MariaDB Corporation Ab and others.
    36  
    37  Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.
    38  
    39  MySQL [(none)]> show databases;
    40  +--------------------+
    41  | Database           |
    42  +--------------------+
    43  | information_schema |
    44  | mysql              |
    45  | performance_schema |
    46  | sys                |
    47  +--------------------+
    48  4 rows in set (0.00 sec)
    49  ```