arana-db / arana

Arana is a Cloud Native Database Proxy. It can also be deployed as a Database mesh sidecar.
http://arana-docs.rtfd.io/
Apache License 2.0
292 stars 92 forks source link

arana start error #793

Closed dobet closed 9 months ago

dobet commented 11 months ago

What happened: use this config , connect error ERROR mysql/server.go:260 Error authenticating user using MySQL native password: Access denied for user 'root' (errno 1045) (sqlstate 28000) What you expected to happen: connect success How to reproduce it (as minimally and precisely as possible):

Anything else we need to know?:

kind: ConfigMap
apiVersion: "1.0"
metadata:
  name: arana-config
data:
  tenants:
    - name: arana
      sys_db:
        host: 10.116.34.82
        port: 3306
        username: root
        password: "Qwer1234"
        # TODO It is recommended that the initialization of the subsequent system library be handled by arana internally
        database: __arana_sys
        weight: r10w10
        parameters:
      users:
        - username: root
          password: "Qwer1234"

data:
  tenants:
    - name: arana
      sys_db:
        host: 10.116.34.82
        port: 3306
        username: root
        password: "Qwer1234"
        # TODO It is recommended that the initialization of the subsequent system library be handled by arana internally
        database: __arana_sys
        weight: r10w10
        parameters:
      users:
        - username: root
          password: "Qwer1234"
          # - username: arana
          #password: "123456"
      clusters:
        - name: employees
          type: mysql
          sql_max_limit: -1
          tenant: root
          parameters:
            slow_threshold: 1s
            max_allowed_packet: 256M
          groups:
            - name: employees_0000
              nodes:
                - node0
            - name: employees_0001
              nodes:
                - node1
      nodes:
        node0:
          name: node0
          host: 10.116.34.82
          port: 3306
          username: root
          password: "Qwer1234"
          database: sbtest
          weight: r10w10
          parameters:
        node1:
          name: node1
          host: 10.116.34.81
          port: 3306
          username: root
          password: "Qwer1234"
          database: sbtest
          weight: r10w10
          parameters:
dobet commented 11 months ago

mysql version: 5.7.40-log, 8.1.0 mysql client version: 14.14 Distrib 5.7.30

baerwang commented 11 months ago

pls err detail info report

dobet commented 10 months ago

I change mysql client to mysql Ver 8.0.34-0ubuntu0.20.04.1 for Linux on x86_64 ((Ubuntu)),

image

but also connect error

dobet commented 10 months ago

connect to mysql is success

image

this is arana error image

baerwang commented 10 months ago

your config password is not 123456

dobet commented 9 months ago

don't comment config,and use like this

#
# Licensed to the Apache Software Foundation (ASF) under one or more
# contributor license agreements.  See the NOTICE file distributed with
# this work for additional information regarding copyright ownership.
# The ASF licenses this file to You under the Apache License, Version 2.0
# (the "License"); you may not use this file except in compliance with
# the License.  You may obtain a copy of the License at
#
#     http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#

kind: ConfigMap
apiVersion: "1.0"
metadata:
  name: arana-config
data:
  tenants:
    - name: arana
      sys_db:
        host: 0.0.0.0
        port: 3306
        username: root
        password: "123456"
        # TODO It is recommended that the initialization of the subsequent system library be handled by arana internally
        database: __arana_sys
        weight: r10w10
        parameters:
      users:
        - username: root
          password: "123456"
        - username: arana
          password: "123456"
      clusters:
        - name: employees
          type: mysql
          sql_max_limit: -1
          tenant: arana
          parameters:
            slow_threshold: 1s
            max_allowed_packet: 256M
          groups:
            - name: employees_0000
              nodes:
                - node0
                # - node0_r_0
            - name: employees_0001
              nodes:
                - node1
            # - name: employees_0002
            #   nodes:
            #     - node2
            # - name: employees_0003
            #   nodes:
            #     - node3
      sharding_rule:
        tables:
          - name: employees.student
            sequence:
              type: snowflake
              option:
            db_rules:
              - columns:
                  - name: uid
                expr: parseInt($0 % 32 / 8)
            tbl_rules:
              - columns:
                  - name: uid
                expr: $0 % 32
            topology:
              db_pattern: employees_${0000..0003}
              tbl_pattern: student_${0000..0031}
            attributes:
              allow_full_scan: true
              sqlMaxLimit: -1
          - name: employees.friendship
            sequence:
              type: snowflake
              option:
            db_rules:
              - columns:
                  - name: uid
                  - name: friend_id
                expr: parseInt(($0*31+$1) % 32 / 8)
            tbl_rules:
              - columns:
                  - name: uid
                  - name: friend_id
                expr: ($0*31+$1) % 32
            topology:
              db_pattern: employees_${0000..0003}
              tbl_pattern: friendship_${0000..0031}
            attributes:
              allow_full_scan: true
              sqlMaxLimit: -1
      nodes:
        node0:
          name: node0
          host: arana-mysql
          port: 3306
          username: root
          password: "123456"
          database: employees_0000
          weight: r10w10
          parameters:
        # node0_r_0:
        #   name: node0_r_0
        #   host: 0.0.0.0
        #   port: 3306
        #   username: root
        #   password: "123456"
        #   database: employees_0000_r
        #   weight: r0w0
        #   parameters:
        node1:
          name: node1
          host: 0.0.0.0
          port: 3307
          username: root
          password: "123456"
          database: employees_0001
          weight: r10w10
          parameters:
        # node2:
        #   name: node2
        #   host: 0.0.0.0
        #   port: 3306
        #   username: root
        #   password: "123456"
        #   database: employees_0002
        #   weight: r10w10
        #   parameters:
        # node3:
        #   name: node3
        #   host: 0.0.0.0
        #   port: 3306
        #   username: root
        #   password: "123456"
        #   database: employees_0003
        #   weight: r10w10
        #   parameters:

arana start success.