Hướng dẫn mongodb bi connector authentication - xác thực trình kết nối bi mongodb

Tài liệu về nhà → Đầu nối MongoDB cho BIMongoDB Connector for BI

Đầu nối MongoDB cho BI hỗ trợ các cơ chế xác thực sau để xác thực với MongoDB và để xác thực người dùng kết nối:

  • mongosqld --mongo-uri "mongodb://:/?connect=direct"

    5

  • mongosqld --mongo-uri "mongodb://:/?connect=direct"

    6

  • mongosqld --mongo-uri "mongodb://:/?connect=direct"

    7 [LDAP]

  • mongosqld --mongo-uri "mongodb://:/?connect=direct"

    8 [Kerberos]

Đầu nối BI [

mongosqld --mongo-uri "mongodb://:/?connect=direct"

9] sử dụng thông tin xác thực quản trị để xác thực với MongoDB và dữ liệu mẫu để tạo lược đồ của Trình kết nối BI. Khi khách hàng kết nối với đầu nối BI,

mongosqld --mongo-uri "mongodb://:/?connect=direct"

9 chuyển thông tin đăng nhập của khách hàng với MongoDB để xác thực và sẽ hiển thị và hạn chế dữ liệu theo quyền của người dùng kết nối.

Các phần sau đây sẽ hướng dẫn bạn thông qua việc định cấu hình trình kết nối BI để xác thực với triển khai MongoDB của bạn, định cấu hình xác thực người dùng kết nối với Trình kết nối BI và cách định dạng tên người dùng từ công cụ BI của bạn bằng các tùy chọn xác thực.

Nếu xác thực được bật trên triển khai MongoDB của bạn, bạn phải định cấu hình Trình kết nối BI để sử dụng cơ chế xác thực cần thiết và cung cấp thông tin đăng nhập của người dùng quản trị. Thông tin đăng nhập của người dùng quản trị phải được ủy quyền để xem siêu dữ liệu bạn muốn truy vấn bằng Trình kết nối BI.authorized to view the superset of data you wish to query using the BI Connector.

Nếu công cụ BI của bạn đang sử dụng trình điều khiển ODBC của MongoDB BI, trình điều khiển sẽ xử lý xác thực và bạn không cần phải cài đặt plugin xác thực. Nếu bạn không sử dụng trình điều khiển ODBC đầu nối MongoDB BI và cần xác thực bằng công cụ BI của bạn, hãy cài đặt plugin xác thực C hoặc JDBC tùy thuộc vào loại nào tương thích với công cụ BI của bạn:

C plugininStruictions để cài đặt plugin xác thực C, tạo điều kiện xác thực giữa Trình kết nối BI và máy khách SQL như Tableau và MySQL Shell.

Để biết thêm thông tin về việc kết nối các công cụ BI với đầu nối BI, hãy xem Connect BI Tools.

Quan trọng

Việc sử dụng TLS/SSL được khuyến nghị ngoài việc sử dụng plugin xác thực như:

  • Các cơ chế

    mongosqld --mongo-uri "mongodb://:/?connect=direct"

    5 và

    mongosqld --mongo-uri "mongodb://:/?connect=direct"

    6 băm mật khẩu trong plugin máy khách. Tuy nhiên, tất cả các dữ liệu khác là trong Cleartext.

  • Cơ chế

    mongosqld --mongo-uri "mongodb://:/?connect=direct"

    7 gửi mật khẩu trong Cleartext.

Đầu nối MongoDB cho BI yêu cầu xác thực khi chạy với

mongosqld --mongo-versionCompatibility 3.2

4. Khi Trình kết nối MongoDB cho BI nhận được kết nối với thông tin xác thực từ khách hàng, nó sẽ chuyển các thông tin đó qua phiên bản MongoDB cơ bản.

Bạn có thể chỉ định các tùy chọn xác thực sau sau tên người dùng của bạn dưới dạng tham số truy vấn kiểu URI:

Tùy chọn kết nối

Sự mô tả

mongosqld --mongo-versionCompatibility 3.2

5

Chỉ định tên của cơ sở dữ liệu lưu trữ thông tin đăng nhập của người dùng. Nếu bạn không chỉ định tùy chọn này, đầu nối MongoDB cho BI sẽ mặc định với cơ sở dữ liệu hiện tại được liên kết với kết nối MySQL.

Đối với các cơ chế xác thực như

mongosqld --mongo-uri "mongodb://:/?connect=direct"

7 [LDAP] hoặc

mongosqld --mongo-uri "mongodb://:/?connect=direct"

8 [Kerberos] ủy thác lưu trữ thông tin xác thực cho các dịch vụ khác, đặt giá trị

mongosqld --mongo-versionCompatibility 3.2

5 thành

mongosqld --mongo-versionCompatibility 3.2

9.

Không bắt buộc nếu

{ "_id" : 1, "a" : 3, "b" : [ "orange", "apple", "pear" ] }

0 được đặt trong đầu nối MongoDB của bạn cho tệp cấu hình BI.

{ "_id" : 1, "a" : 3, "b" : [ "orange", "apple", "pear" ] }

1

Chỉ định cơ chế mà đầu nối MongoDB cho BI nên sử dụng để xác thực kết nối. Các giá trị được chấp nhận bao gồm:

  • Scram-sha-1 [mặc định] [default]

  • SCRAM-SHA-256

  • Đồng bằng [LDAP SASL] [LDAP SASL]

  • GSSAPI [Kerberos] [Kerberos]

LDAP và Kerberos yêu cầu MongoDB Enterprise. Đặt nguồn thành

mongosqld --mongo-versionCompatibility 3.2

9 khi sử dụng LDAP hoặc Kerberos.MongoDB Enterprise. Set the source to

mongosqld --mongo-versionCompatibility 3.2

9 when using LDAP or Kerberos.

Không bắt buộc nếu

{ "_id" : 1, "a" : 3, "b" : [ "orange", "apple", "pear" ] }

3 được đặt trong đầu nối MongoDB của bạn cho tệp cấu hình BI.

Ghi chú

X.509 không được hỗ trợ.

Ví dụ sau đây cho thấy cách định dạng tên người dùng để xác thực với trình kết nối BI bằng cách sử dụng thử thách và phản hồi [tên người dùng và mật khẩu], LDAP hoặc Kerberos:LDAP, or Kerberos:

Trên trang này

  • Sự mô tả
  • Cách sử dụng
  • Bắt đầu

    mongosqld --mongo-uri "mongodb://:/?connect=direct"

    9 với tệp lược đồ
  • Bắt đầu

    mongosqld --mongo-uri "mongodb://:/?connect=direct"

    9 với cơ sở dữ liệu lược đồ
  • Bắt đầu

    mongosqld --mongo-uri "mongodb://:/?connect=direct"

    9 với các không gian tên được chỉ định
  • Quyền của người dùng MongoDB
  • Phiên bản TLS tối thiểu mặc định
  • Tùy chọn dòng lệnh
  • Tùy chọn cốt lõi
  • Tùy chọn lược đồ
  • Tùy chọn nhật ký
  • Các tùy chọn MongoDB TLS/SSL
  • Tùy chọn TLS/SSL của máy khách
  • Tùy chọn dịch vụ
  • Tùy chọn Kerberos
  • Tùy chọn ổ cắm
  • Đặt tùy chọn tham số
  • Tập tin cấu hình
  • Tùy chọn ghi nhật ký
  • Tùy chọn lược đồ
  • Tùy chọn nhật ký
  • Các tùy chọn MongoDB TLS/SSL
  • Tùy chọn TLS/SSL của máy khách
  • Tùy chọn dịch vụ
  • Tùy chọn Kerberos
  • Tùy chọn ổ cắm
  • Đặt tùy chọn tham số
  • Tập tin cấu hình
  • Tùy chọn ghi nhật ký
  • Tùy chọn lấy mẫu dữ liệu
  • Tùy chọn thời gian chạy
  • Tùy chọn mạng
  • Tùy chọn bảo mật
  • Tùy chọn máy chủ MongoDB
  • Tùy chọn quản lý quy trình
  • Đặt tùy chọn tham số
  • Tải các giá trị cấu hình bên ngoài
  • Ví dụ Tệp cấu hình
  • Ví dụ sử dụng
  • mongosqld --mongo-uri "mongodb://:/?connect=direct"

    9 với tệp lược đồ
  • Chỉ định một bộ sưu tập để lấy mẫu
  • Chỉ định nhiều bộ sưu tập để lấy mẫu

Ghi chú

Với Cấp miễn phí MongoDB Atlas, Trình kết nối BI không thể chạy các đường ống tổng hợp bằng tùy chọn

mongosqld --mongo-versionCompatibility 3.2

00. Tùy chọn này cho phép các giai đoạn tổng hợp ghi dữ liệu dưới dạng tệp tạm thời vào đĩa. Để xem xét các ràng buộc cấp miễn phí của MongoDB Atlas, hãy xem Hướng dẫn Atlas MongoDB.currently supported MongoDB server versions.

mongosqld --mongo-uri "mongodb://:/?connect=direct"

9 chấp nhận các yêu cầu đến từ máy khách SQL và ủy quyền các yêu cầu đó đến một ví dụ
mysql> select * from test;
+------+------+
| _id | a |
+------+------+
| 1 | 3 |
+------+------+
mysql> select * from test_b;
+------+--------+-------+
| _id | b | b_idx |
+------+--------+-------+
| 1 | orange | 0 |
| 1 | apple | 1 |
| 1 | pear | 2 |
+------+--------+-------+
1 hoặc
mysql> select * from test;
+------+------+
| _id | a |
+------+------+
| 1 | 3 |
+------+------+
mysql> select * from test_b;
+------+--------+-------+
| _id | b | b_idx |
+------+--------+-------+
| 1 | orange | 0 |
| 1 | apple | 1 |
| 1 | pear | 2 |
+------+--------+-------+
2. accepts incoming requests from a SQL client and proxies those requests to a
mysql> select * from test;
+------+------+
| _id | a |
+------+------+
| 1 | 3 |
+------+------+
mysql> select * from test_b;
+------+--------+-------+
| _id | b | b_idx |
+------+--------+-------+
| 1 | orange | 0 |
| 1 | apple | 1 |
| 1 | pear | 2 |
+------+--------+-------+
1
or
mysql> select * from test;
+------+------+
| _id | a |
+------+------+
| 1 | 3 |
+------+------+
mysql> select * from test_b;
+------+--------+-------+
| _id | b | b_idx |
+------+--------+-------+
| 1 | orange | 0 |
| 1 | apple | 1 |
| 1 | pear | 2 |
+------+--------+-------+
2
instance.

Mới trong phiên bản 2.3:

Bạn có thể bắt đầu

mongosqld --mongo-uri "mongodb://:/?connect=direct"

9 bằng tệp lược đồ ở định dạng .drdl bằng tùy chọn
mysql> select * from test;
+------+------+
| _id | a |
+------+------+
| 1 | 3 |
+------+------+
mysql> select * from test_b;
+------+--------+-------+
| _id | b | b_idx |
+------+--------+-------+
| 1 | orange | 0 |
| 1 | apple | 1 |
| 1 | pear | 2 |
+------+--------+-------+
4 hoặc bằng cách lấy mẫu dữ liệu từ một thể hiện MongoDB để tạo lược đồ.

mongosqld --mongo-uri "mongodb://:/?connect=direct"

9
either with a schema file in .drdl format using the
mysql> select * from test;
+------+------+
| _id | a |
+------+------+
| 1 | 3 |
+------+------+
mysql> select * from test_b;
+------+--------+-------+
| _id | b | b_idx |
+------+--------+-------+
| 1 | orange | 0 |
| 1 | apple | 1 |
| 1 | pear | 2 |
+------+--------+-------+
4
option or by sampling data from a MongoDB instance to create the schema.

Bạn có thể chỉ định không gian tên hoặc không gian tên nào để lấy mẫu dữ liệu từ tùy chọn

mysql> select * from test;
+------+------+
| _id | a |
+------+------+
| 1 | 3 |
+------+------+
mysql> select * from test_b;
+------+--------+-------+
| _id | b | b_idx |
+------+--------+-------+
| 1 | orange | 0 |
| 1 | apple | 1 |
| 1 | pear | 2 |
+------+--------+-------+
5. Nếu bạn không chỉ định bất kỳ không gian tên hoặc tệp lược đồ nào,

mongosqld --mongo-uri "mongodb://:/?connect=direct"

9 mẫu dữ liệu từ tất cả các cơ sở dữ liệu trong phiên bản MongoDB đích ngoại trừ cơ sở dữ liệu
mysql> select * from test;
+------+------+
| _id | a |
+------+------+
| 1 | 3 |
+------+------+
mysql> select * from test_b;
+------+--------+-------+
| _id | b | b_idx |
+------+--------+-------+
| 1 | orange | 0 |
| 1 | apple | 1 |
| 1 | pear | 2 |
+------+--------+-------+
7 và
mysql> select * from test;
+------+------+
| _id | a |
+------+------+
| 1 | 3 |
+------+------+
mysql> select * from test_b;
+------+--------+-------+
| _id | b | b_idx |
+------+--------+-------+
| 1 | orange | 0 |
| 1 | apple | 1 |
| 1 | pear | 2 |
+------+--------+-------+
8.
mysql> select * from test;
+------+------+
| _id | a |
+------+------+
| 1 | 3 |
+------+------+
mysql> select * from test_b;
+------+--------+-------+
| _id | b | b_idx |
+------+--------+-------+
| 1 | orange | 0 |
| 1 | apple | 1 |
| 1 | pear | 2 |
+------+--------+-------+
5
option. If you don't specify any namespaces or a schema file,

mongosqld --mongo-uri "mongodb://:/?connect=direct"

9
samples data from all databases in the target MongoDB instance except the
mysql> select * from test;
+------+------+
| _id | a |
+------+------+
| 1 | 3 |
+------+------+
mysql> select * from test_b;
+------+--------+-------+
| _id | b | b_idx |
+------+--------+-------+
| 1 | orange | 0 |
| 1 | apple | 1 |
| 1 | pear | 2 |
+------+--------+-------+
7 and
mysql> select * from test;
+------+------+
| _id | a |
+------+------+
| 1 | 3 |
+------+------+
mysql> select * from test_b;
+------+--------+-------+
| _id | b | b_idx |
+------+--------+-------+
| 1 | orange | 0 |
| 1 | apple | 1 |
| 1 | pear | 2 |
+------+--------+-------+
8 databases.

Bạn có thể chỉ định cơ sở dữ liệu để lưu trữ thông tin lược đồ với tùy chọn

mysql> select * from test;
+------+------+
| _id | a |
+------+------+
| 1 | 3 |
+------+------+
mysql> select * from test_b;
+------+--------+-------+
| _id | b | b_idx |
+------+--------+-------+
| 1 | orange | 0 |
| 1 | apple | 1 |
| 1 | pear | 2 |
+------+--------+-------+
9. Nếu không,

mongosqld --mongo-uri "mongodb://:/?connect=direct"

9 giữ lược đồ trong bộ nhớ.
mysql> select * from test;
+------+------+
| _id | a |
+------+------+
| 1 | 3 |
+------+------+
mysql> select * from test_b;
+------+--------+-------+
| _id | b | b_idx |
+------+--------+-------+
| 1 | orange | 0 |
| 1 | apple | 1 |
| 1 | pear | 2 |
+------+--------+-------+
9
option. Otherwise,

mongosqld --mongo-uri "mongodb://:/?connect=direct"

9
holds the schema in memory.

Sử dụng tùy chọn

mysql> select * from test;
+------+------+
| _id | a |
+------+------+
| 1 | 3 |
+------+------+
mysql> select * from test_b;
+------+--------+-------+
| _id | b | b_idx |
+------+--------+-------+
| 1 | orange | 0 |
| 1 | apple | 1 |
| 1 | pear | 2 |
+------+--------+-------+
4 để chỉ định tệp lược đồ khi bắt đầu

mongosqld --mongo-uri "mongodb://:/?connect=direct"

9
mysql> select * from test;
+------+------+
| _id | a |
+------+------+
| 1 | 3 |
+------+------+
mysql> select * from test_b;
+------+--------+-------+
| _id | b | b_idx |
+------+--------+-------+
| 1 | orange | 0 |
| 1 | apple | 1 |
| 1 | pear | 2 |
+------+--------+-------+
4
option to specify a schema file when starting

mongosqld --mongo-uri "mongodb://:/?connect=direct"

9

mongosqld --schema /path/to/schema-file.drdl

Sử dụng

mysql> select * from test_b;
+------+------+--------+-------+
| _id | a | b | b_idx |
+------+------+--------+-------+
| 1 | 3 | orange | 0 |
| 1 | 3 | apple | 1 |
| 1 | 3 | pear | 2 |
+------+------+--------+-------+
3 để tạo tệp lược đồ từ một thể hiện MongoDB.

Sử dụng tùy chọn

mysql> select * from test;
+------+------+
| _id | a |
+------+------+
| 1 | 3 |
+------+------+
mysql> select * from test_b;
+------+--------+-------+
| _id | b | b_idx |
+------+--------+-------+
| 1 | orange | 0 |
| 1 | apple | 1 |
| 1 | pear | 2 |
+------+--------+-------+
9 để chỉ định cơ sở dữ liệu để lưu trữ thông tin lược đồ.
mysql> select * from test;
+------+------+
| _id | a |
+------+------+
| 1 | 3 |
+------+------+
mysql> select * from test_b;
+------+--------+-------+
| _id | b | b_idx |
+------+--------+-------+
| 1 | orange | 0 |
| 1 | apple | 1 |
| 1 | pear | 2 |
+------+--------+-------+
9
option to specify a database to store schema information.

mongosqld --schemaSource sampleDb

Sử dụng tùy chọn

mysql> select * from test;
+------+------+
| _id | a |
+------+------+
| 1 | 3 |
+------+------+
mysql> select * from test_b;
+------+--------+-------+
| _id | b | b_idx |
+------+--------+-------+
| 1 | orange | 0 |
| 1 | apple | 1 |
| 1 | pear | 2 |
+------+--------+-------+
5 để chỉ định cơ sở dữ liệu và bộ sưu tập cho

mongosqld --mongo-uri "mongodb://:/?connect=direct"

9 để lấy mẫu dữ liệu từ để tạo lược đồ.
mysql> select * from test;
+------+------+
| _id | a |
+------+------+
| 1 | 3 |
+------+------+
mysql> select * from test_b;
+------+--------+-------+
| _id | b | b_idx |
+------+--------+-------+
| 1 | orange | 0 |
| 1 | apple | 1 |
| 1 | pear | 2 |
+------+--------+-------+
5
option to specify databases and collections for

mongosqld --mongo-uri "mongodb://:/?connect=direct"

9
to sample data from to create the schema.

mongosqld --sampleNamespaces contacts.addresses

Xem các ví dụ sử dụng bổ sung dưới đây.usage examples below.

Nếu phiên bản MongoDB của bạn sử dụng xác thực, phiên bản đầu nối BI của bạn cũng phải sử dụng xác thực. Người dùng kết nối với MongoDB thông qua chương trình

mongosqld --mongo-uri "mongodb://:/?connect=direct"

9 phải có quyền đọc từ tất cả các không gian tên bạn muốn lấy mẫu dữ liệu.authentication, your BI Connector instance must also use authentication. The user that connects to MongoDB via the

mongosqld --mongo-uri "mongodb://:/?connect=direct"

9
program must have permission to read from all the namespaces you wish to sample data from.

Để biết thêm chi tiết về quyền của người dùng MongoDB trong Trình kết nối BI, hãy xem quyền của người dùng để lấy mẫu được lưu trong bộ nhớ cache.

Để biết thêm thông tin về người dùng MongoDB và vai trò, hãy xem Kiểm soát truy cập dựa trên vai trò.Role-Based Access Control.

Xem ví dụ dưới đây của

mongosqld --mongo-uri "mongodb://:/?connect=direct"

9 với xác thực.example below of

mongosqld --mongo-uri "mongodb://:/?connect=direct"

9
with authentication.

Mới trong phiên bản 2.6.

Phiên bản TLS tối thiểu mặc định là 1.1 cho tất cả các kết nối máy khách. Điều này bao gồm các kết nối khách hàng đến

mongosqld --mongo-uri "mongodb://:/?connect=direct"

9 và các kết nối đi đến MongoDB.

mongosqld --mongo-uri "mongodb://:/?connect=direct"

9
and outgoing connections to MongoDB.

Bạn có thể điều chỉnh cài đặt này cho các kết nối đến với tùy chọn

mongosqld --setParameter "type_conversion_mode=mongosql"

0 và cho các kết nối đi với tùy chọn

mongosqld --setParameter "type_conversion_mode=mongosql"

1.

mongosqld --setParameter "type_conversion_mode=mongosql"

0
option and for outgoing connections with the

mongosqld --setParameter "type_conversion_mode=mongosql"

1
option.

mongosqld --setParameter "type_conversion_mode=mongosql"

2 returns thông tin về các tùy chọn và sử dụng

mongosqld --mongo-uri "mongodb://:/?connect=direct"

9

Returns information on the options and use of

mongosqld --mongo-uri "mongodb://:/?connect=direct"

9

mongosqld --setParameter "type_conversion_mode=mongosql"

4Default: 127.0.0.1:3307

Default: 127.0.0.1:3307

Chỉ định địa chỉ máy chủ để lắng nghe.

mongosqld --setParameter "type_conversion_mode=mongosql"

55returns Số phát hành

mongosqld --mongo-uri "mongodb://:/?connect=direct"

9.

Returns the

mongosqld --mongo-uri "mongodb://:/?connect=direct"

9 release number.

mongosqld --setParameter "type_conversion_mode=mongosql"

7 Chỉ định đường dẫn đến tệp cấu hình.

Specifies the path to a configuration file.

mongosqld --setParameter "type_conversion_mode=mongosql"

8Default: MongoDB: // Localhost: 27017

Default: mongodb://localhost:27017

Chỉ định chuỗi kết nối MongoDB để kết nối với.connection string to connect to.

Tùy chọn

mongosqld --setParameter "type_conversion_mode=mongosql"

9 hỗ trợ các tùy chọn sau trong chuỗi kết nối:

mongosqld --setParameter "type_conversion_mode=mongosql"

9
option supports the following options within the connection string:

  • systemLog:
    logAppend:
    logRotate: "rename"|"reopen"
    path:
    quiet:
    verbosity:
    0

  • systemLog:
    logAppend:
    logRotate: "rename"|"reopen"
    path:
    quiet:
    verbosity:
    1

  • systemLog:
    logAppend:
    logRotate: "rename"|"reopen"
    path:
    quiet:
    verbosity:
    2

  • systemLog:
    logAppend:
    logRotate: "rename"|"reopen"
    path:
    quiet:
    verbosity:
    3

Để biết thêm thông tin về các tùy chọn URI này, hãy xem tùy chọn tùy chọn ưu tiên và tùy chọn đặt bản sao.Read Preference Options and Replica Set Option.

Đối với các tùy chọn được đặt trong Mongo URI không có trong danh sách ở trên, hãy sử dụng tùy chọn tương đương

mongosqld --mongo-uri "mongodb://:/?connect=direct"

9. Để biết danh sách đầy đủ các tùy chọn

mongosqld --mongo-uri "mongodb://:/?connect=direct"

9, hãy xem các tùy chọn dòng lệnh.

mongosqld --mongo-uri "mongodb://:/?connect=direct"

9
option. For the complete list of

mongosqld --mongo-uri "mongodb://:/?connect=direct"

9
options, see Command Line Options.

Ghi chú

Thay vì chỉ định

systemLog:
logAppend:
logRotate: "rename"|"reopen"
path:
quiet:
verbosity:
6 và
systemLog:
logAppend:
logRotate: "rename"|"reopen"
path:
quiet:
verbosity:
7 trong chuỗi kết nối của bạn, hãy chạy

mongosqld --mongo-uri "mongodb://:/?connect=direct"

9 với tùy chọn

mongosqld --mongo-versionCompatibility 3.2

4 để hướng

mongosqld --mongo-uri "mongodb://:/?connect=direct"

9 để chuyển thông tin xác thực do máy khách SQL cung cấp cho máy chủ MongoDB.

mongosqld --mongo-uri "mongodb://:/?connect=direct"

9
with the

mongosqld --mongo-versionCompatibility 3.2

4
option to direct

mongosqld --mongo-uri "mongodb://:/?connect=direct"

9
to pass the authentication credentials provided by the SQL client to the MongoDB server.

Tương tự, thay vì bật

mongosqld --schemaSource sampleDb

01 trong chuỗi kết nối, chạy

mongosqld --mongo-uri "mongodb://:/?connect=direct"

9 với

mongosqld --schemaSource sampleDb

03

mongosqld --schemaSource sampleDb

01
in the connection string, run

mongosqld --mongo-uri "mongodb://:/?connect=direct"

9
with

mongosqld --schemaSource sampleDb

03

Để vô hiệu hóa logic khám phá máy chủ bản sao tự động và buộc kết nối với máy chủ được chỉ định, hãy sử dụng tùy chọn

mongosqld --schemaSource sampleDb

04.

mongosqld --mongo-uri "mongodb://:/?connect=direct"

Các tùy chọn URI không có trong danh sách trên cũng như trong danh sách các

mongosqld --mongo-uri "mongodb://:/?connect=direct"

9Options được hỗ trợ không được hỗ trợ.

mongosqld --mongo-uri "mongodb://:/?connect=direct"

9
options are not supported.

mongosqld --schemaSource sampleDb

06Restricts

mongosqld --mongo-uri "mongodb://:/?connect=direct"

9 để sử dụng các tính năng mà phiên bản được chỉ định của MongoDB hỗ trợ. Chỉ cần thiết khi được sử dụng với các bộ bản sao trong đó các thành viên sử dụng các phiên bản MongoDB khác nhau hoặc khi thực hiện nâng cấp MongoDB. Chỉ hỗ trợ MongoDB phiên bản 3.2 trở lên.

Restricts

mongosqld --mongo-uri "mongodb://:/?connect=direct"

9 to using features that the specified version of MongoDB supports. Only necessary when used with replica sets in which members use different MongoDB versions or when performing a rolling upgrade of MongoDB. Only supports MongoDB version 3.2 or later.

Ví dụ: nếu bộ bản sao của bạn chứa các thành viên chạy MongoDB 3.2 và các thành viên khác chạy MongoDB 3.4, hãy đặt tùy chọn sau để hạn chế

mongosqld --mongo-uri "mongodb://:/?connect=direct"

9 để chỉ sử dụng các tính năng được hỗ trợ bởi MongoDB 3.2:

mongosqld --mongo-uri "mongodb://:/?connect=direct"

9
to only use features supported by MongoDB 3.2:

mongosqld --mongo-versionCompatibility 3.2

mongosqld --schemaSource sampleDb

09New ​​trong phiên bản 2.2.

New in version 2.2.

Chỉ định độ dài tối đa, tính theo ký tự, cho tất cả các trường Varchar. Nếu

mongosqld --mongo-uri "mongodb://:/?connect=direct"

9 gặp một chuỗi dài hơn chiều dài tối đa,

mongosqld --mongo-uri "mongodb://:/?connect=direct"

9 cắt nó theo chiều dài tối đa và ghi lại cảnh báo.

mongosqld --mongo-uri "mongodb://:/?connect=direct"

9
encounters a string that is longer than the maximum length,

mongosqld --mongo-uri "mongodb://:/?connect=direct"

9
truncates it to the maximum length and logs a warning.

mongosqld --schemaSource sampleDb

12New trong phiên bản 2.3.

New in version 2.3.

Chỉ định tên người dùng xác thực để sử dụng để khám phá lược đồ. Chỉ yêu cầu nếu

mongosqld --mongo-versionCompatibility 3.2

4 được bật. Người dùng được chỉ định bởi

mongosqld --schemaSource sampleDb

14 phải là người dùng MongoDB hợp lệ với đặc quyền

mongosqld --schemaSource sampleDb

15. Xem các quyền của người dùng Mongoosqld.

mongosqld --mongo-versionCompatibility 3.2

4
is enabled. The user specified by

mongosqld --schemaSource sampleDb

14 must be a valid MongoDB user with the

mongosqld --schemaSource sampleDb

15 privilege. See mongosqld User Permissions.

mongosqld --schemaSource sampleDb

16New trong phiên bản 2.3.

New in version 2.3.

Chỉ định mật khẩu xác thực để sử dụng để khám phá lược đồ. Chỉ yêu cầu nếu

mongosqld --mongo-versionCompatibility 3.2

4 được bật. Sử dụng kết hợp với

mongosqld --schemaSource sampleDb

14

mongosqld --mongo-versionCompatibility 3.2

4
is enabled. Use in conjunction with

mongosqld --schemaSource sampleDb

14

mongosqld --schemaSource sampleDb

19default: Quản trị viên

Default: admin

Mới trong phiên bản 2.3.

Chỉ định cơ sở dữ liệu giữ thông tin đăng nhập cho người dùng Discovery Schema. Chỉ có sẵn nếu

mongosqld --mongo-versionCompatibility 3.2

4 được bật. Sử dụng kết hợp với các tùy chọn thông tin xác thực

mongosqld --schemaSource sampleDb

14 và

mongosqld --schemaSource sampleDb

22

mongosqld --mongo-versionCompatibility 3.2

4
is enabled. Use in conjunction with credential options

mongosqld --schemaSource sampleDb

14
and

mongosqld --schemaSource sampleDb

22

mongosqld --schemaSource sampleDb

23Default: Scram-sha-1

Default: SCRAM-SHA-1

Mới trong phiên bản 2.3.

Chỉ định cơ chế xác thực để sử dụng để khám phá lược đồ. Chỉ có sẵn nếu

mongosqld --mongo-versionCompatibility 3.2

4 được bật. Sử dụng kết hợp với các tùy chọn thông tin xác thực

mongosqld --schemaSource sampleDb

14 và

mongosqld --schemaSource sampleDb

22

mongosqld --mongo-versionCompatibility 3.2

4
is enabled. Use in conjunction with credential options

mongosqld --schemaSource sampleDb

14
and

mongosqld --schemaSource sampleDb

22

Giá trị

Sự mô tả

SCRAM-SHA-1

RFC 5802 Cơ chế xác thực phản ứng thách thức muối tiêu chuẩn sử dụng hàm băm SHA1. standard Salted Challenge Response Authentication Mechanism using the SHA1 hash function.

SCRAM-SHA-256

Mới trong Phiên bản 2.6: RFC 7677 Cơ chế xác thực phản ứng thách thức muối tiêu chuẩn sử dụng hàm băm SHA2.RFC 7677 standard Salted Challenge Response Authentication Mechanism using the SHA2 hash function.

Đồng bằng [LDAP SASL] [LDAP SASL]

Xác thực bên ngoài bằng LDAP. Bạn cũng có thể sử dụng

mongosqld --mongo-uri "mongodb://:/?connect=direct"

7 để xác thực người dùng trong cơ sở dữ liệu.

mongosqld --mongo-uri "mongodb://:/?connect=direct"

7 Truyền mật khẩu bằng văn bản đơn giản. Cơ chế này chỉ có sẵn trong MongoDB Enterprise.MongoDB Enterprise.

GSSAPI [Kerberos] [Kerberos]

Xác thực bên ngoài bằng cách sử dụng kerberos. Cơ chế này chỉ có sẵn trong MongoDB Enterprise.MongoDB Enterprise.

mongosqld --schemaSource sampleDb

29 Chỉ định đường dẫn đến tệp lược đồ hoặc thư mục lược đồ.

Specifies the path to a schema file or the schema directory.

mongosqld --schemaSource sampleDb

30Deprecated kể từ phiên bản 2.2.

Deprecated since version 2.2.

Sử dụng

mysql> select * from test;
+------+------+
| _id | a |
+------+------+
| 1 | 3 |
+------+------+
mysql> select * from test_b;
+------+--------+-------+
| _id | b | b_idx |
+------+--------+-------+
| 1 | orange | 0 |
| 1 | apple | 1 |
| 1 | pear | 2 |
+------+--------+-------+
4 thay thế.
mysql> select * from test;
+------+------+
| _id | a |
+------+------+
| 1 | 3 |
+------+------+
mysql> select * from test_b;
+------+--------+-------+
| _id | b | b_idx |
+------+--------+-------+
| 1 | orange | 0 |
| 1 | apple | 1 |
| 1 | pear | 2 |
+------+--------+-------+
4
instead.

mongosqld --schemaSource sampleDb

32New trong phiên bản 2.5.

New in version 2.5.

mysql> select * from test;
+------+------+
| _id | a |
+------+------+
| 1 | 3 |
+------+------+
mysql> select * from test_b;
+------+--------+-------+
| _id | b | b_idx |
+------+--------+-------+
| 1 | orange | 0 |
| 1 | apple | 1 |
| 1 | pear | 2 |
+------+--------+-------+
5 Chỉ định cơ sở dữ liệu và bộ sưu tập để bao gồm hoặc loại trừ khỏi quy trình lấy mẫu dữ liệu tạo ra lược đồ. Cũng có thể chỉ định nhiều bộ sưu tập từ một cơ sở dữ liệu hoặc nhiều bộ sưu tập từ nhiều cơ sở dữ liệu. Xem ví dụ dưới đây.examples below.

Nếu bạn không sử dụng tùy chọn

mysql> select * from test;
+------+------+
| _id | a |
+------+------+
| 1 | 3 |
+------+------+
mysql> select * from test_b;
+------+--------+-------+
| _id | b | b_idx |
+------+--------+-------+
| 1 | orange | 0 |
| 1 | apple | 1 |
| 1 | pear | 2 |
+------+--------+-------+
5 hoặc tùy chọn
mysql> select * from test;
+------+------+
| _id | a |
+------+------+
| 1 | 3 |
+------+------+
mysql> select * from test_b;
+------+--------+-------+
| _id | b | b_idx |
+------+--------+-------+
| 1 | orange | 0 |
| 1 | apple | 1 |
| 1 | pear | 2 |
+------+--------+-------+
4,

mongosqld --mongo-uri "mongodb://:/?connect=direct"

9 Dữ liệu mẫu từ tất cả các cơ sở dữ liệu và bộ sưu tập MongoDB có sẵn ngoại trừ cơ sở dữ liệu
mysql> select * from test;
+------+------+
| _id | a |
+------+------+
| 1 | 3 |
+------+------+
mysql> select * from test_b;
+------+--------+-------+
| _id | b | b_idx |
+------+--------+-------+
| 1 | orange | 0 |
| 1 | apple | 1 |
| 1 | pear | 2 |
+------+--------+-------+
7 và
mysql> select * from test;
+------+------+
| _id | a |
+------+------+
| 1 | 3 |
+------+------+
mysql> select * from test_b;
+------+--------+-------+
| _id | b | b_idx |
+------+--------+-------+
| 1 | orange | 0 |
| 1 | apple | 1 |
| 1 | pear | 2 |
+------+--------+-------+
8.
mysql> select * from test;
+------+------+
| _id | a |
+------+------+
| 1 | 3 |
+------+------+
mysql> select * from test_b;
+------+--------+-------+
| _id | b | b_idx |
+------+--------+-------+
| 1 | orange | 0 |
| 1 | apple | 1 |
| 1 | pear | 2 |
+------+--------+-------+
4
option,

mongosqld --mongo-uri "mongodb://:/?connect=direct"

9 samples data from all available MongoDB databases and collections except the
mysql> select * from test;
+------+------+
| _id | a |
+------+------+
| 1 | 3 |
+------+------+
mysql> select * from test_b;
+------+--------+-------+
| _id | b | b_idx |
+------+--------+-------+
| 1 | orange | 0 |
| 1 | apple | 1 |
| 1 | pear | 2 |
+------+--------+-------+
7 and
mysql> select * from test;
+------+------+
| _id | a |
+------+------+
| 1 | 3 |
+------+------+
mysql> select * from test_b;
+------+--------+-------+
| _id | b | b_idx |
+------+--------+-------+
| 1 | orange | 0 |
| 1 | apple | 1 |
| 1 | pear | 2 |
+------+--------+-------+
8 databases.

mongosqld --schemaSource sampleDb

39Default:

mongosqld --schemaSource sampleDb

40

Default:

mongosqld --schemaSource sampleDb

40

Mới trong phiên bản 2.11.

Định cấu hình chế độ lấy mẫu của

mongosqld --mongo-uri "mongodb://:/?connect=direct"

9. Phải được sử dụng với tùy chọn
mysql> select * from test;
+------+------+
| _id | a |
+------+------+
| 1 | 3 |
+------+------+
mysql> select * from test_b;
+------+--------+-------+
| _id | b | b_idx |
+------+--------+-------+
| 1 | orange | 0 |
| 1 | apple | 1 |
| 1 | pear | 2 |
+------+--------+-------+
9. Các giá trị sau xác định hành vi lấy mẫu:sampling mode of

mongosqld --mongo-uri "mongodb://:/?connect=direct"

9
. Must be used with the
mysql> select * from test;
+------+------+
| _id | a |
+------+------+
| 1 | 3 |
+------+------+
mysql> select * from test_b;
+------+--------+-------+
| _id | b | b_idx |
+------+--------+-------+
| 1 | orange | 0 |
| 1 | apple | 1 |
| 1 | pear | 2 |
+------+--------+-------+
9
option. The following values determine the sampling behavior:

Giá trị

Sự mô tả

mongosqld --schemaSource sampleDb

40

RFC 5802 Cơ chế xác thực phản ứng thách thức muối tiêu chuẩn sử dụng hàm băm SHA1. reads a stored schema from the MongoDB database specified by the

mysql> select * from test;
+------+------+
| _id | a |
+------+------+
| 1 | 3 |
+------+------+
mysql> select * from test_b;
+------+--------+-------+
| _id | b | b_idx |
+------+--------+-------+
| 1 | orange | 0 |
| 1 | apple | 1 |
| 1 | pear | 2 |
+------+--------+-------+
9 option.

mongosqld --schemaSource sampleDb

47

Mới trong Phiên bản 2.6: RFC 7677 Cơ chế xác thực phản ứng thách thức muối tiêu chuẩn sử dụng hàm băm SHA2. samples the schema and writes the schema data to the MongoDB database specified by the

mysql> select * from test;
+------+------+
| _id | a |
+------+------+
| 1 | 3 |
+------+------+
mysql> select * from test_b;
+------+--------+-------+
| _id | b | b_idx |
+------+--------+-------+
| 1 | orange | 0 |
| 1 | apple | 1 |
| 1 | pear | 2 |
+------+--------+-------+
9 option.

Đồng bằng [LDAP SASL]Sampling Mode Reference Chart.

Xác thực bên ngoài bằng LDAP. Bạn cũng có thể sử dụng

mongosqld --mongo-uri "mongodb://:/?connect=direct"

7 để xác thực người dùng trong cơ sở dữ liệu.

mongosqld --mongo-uri "mongodb://:/?connect=direct"

7 Truyền mật khẩu bằng văn bản đơn giản. Cơ chế này chỉ có sẵn trong MongoDB Enterprise.

GSSAPI [Kerberos]

New in version 2.11.

Xác thực bên ngoài bằng cách sử dụng kerberos. Cơ chế này chỉ có sẵn trong MongoDB Enterprise.

mongosqld --schemaSource sampleDb

43 is set. Specifies the database where the schema information is stored.

mongosqld --schemaSource sampleDb

29 Chỉ định đường dẫn đến tệp lược đồ hoặc thư mục lược đồ.

mongosqld --schemaSource sampleDb

30Deprecated kể từ phiên bản 2.2.Sampling Mode Reference Chart.

Sử dụng
mysql> select * from test;
+------+------+
| _id | a |
+------+------+
| 1 | 3 |
+------+------+
mysql> select * from test_b;
+------+--------+-------+
| _id | b | b_idx |
+------+--------+-------+
| 1 | orange | 0 |
| 1 | apple | 1 |
| 1 | pear | 2 |
+------+--------+-------+
4 thay thế.

Default:

mongosqld --schemaSource sampleDb

53

Mới trong phiên bản 2.11.

Định cấu hình chế độ lấy mẫu của

mongosqld --mongo-uri "mongodb://:/?connect=direct"

9. Phải được sử dụng với tùy chọn
mysql> select * from test;
+------+------+
| _id | a |
+------+------+
| 1 | 3 |
+------+------+
mysql> select * from test_b;
+------+--------+-------+
| _id | b | b_idx |
+------+--------+-------+
| 1 | orange | 0 |
| 1 | apple | 1 |
| 1 | pear | 2 |
+------+--------+-------+
9. Các giá trị sau xác định hành vi lấy mẫu:
mysql> select * from test;
+------+------+
| _id | a |
+------+------+
| 1 | 3 |
+------+------+
mysql> select * from test_b;
+------+--------+-------+
| _id | b | b_idx |
+------+--------+-------+
| 1 | orange | 0 |
| 1 | apple | 1 |
| 1 | pear | 2 |
+------+--------+-------+
9
database. Specifying schema names allows you to store multiple schemas in the
mysql> select * from test;
+------+------+
| _id | a |
+------+------+
| 1 | 3 |
+------+------+
mysql> select * from test_b;
+------+--------+-------+
| _id | b | b_idx |
+------+--------+-------+
| 1 | orange | 0 |
| 1 | apple | 1 |
| 1 | pear | 2 |
+------+--------+-------+
9
database. The behavior depends on on the value of

mongosqld --schemaSource sampleDb

43

mongosqld --schemaSource sampleDb

43 Hành vi Value

mongosqld --mongo-uri "mongodb://:/?connect=direct"

9 đọc một lược đồ được lưu trữ từ cơ sở dữ liệu MongoDB được chỉ định bởi tùy chọn
mysql> select * from test;
+------+------+
| _id | a |
+------+------+
| 1 | 3 |
+------+------+
mysql> select * from test_b;
+------+--------+-------+
| _id | b | b_idx |
+------+--------+-------+
| 1 | orange | 0 |
| 1 | apple | 1 |
| 1 | pear | 2 |
+------+--------+-------+
9.

mongosqld --schemaSource sampleDb

40

mongosqld --mongo-uri "mongodb://:/?connect=direct"

9 lấy mẫu lược đồ và ghi dữ liệu lược đồ vào cơ sở dữ liệu MongoDB được chỉ định bởi tùy chọn
mysql> select * from test;
+------+------+
| _id | a |
+------+------+
| 1 | 3 |
+------+------+
mysql> select * from test_b;
+------+--------+-------+
| _id | b | b_idx |
+------+--------+-------+
| 1 | orange | 0 |
| 1 | apple | 1 |
| 1 | pear | 2 |
+------+--------+-------+
9.
mysql> select * from test;
+------+------+
| _id | a |
+------+------+
| 1 | 3 |
+------+------+
mysql> select * from test_b;
+------+--------+-------+
| _id | b | b_idx |
+------+--------+-------+
| 1 | orange | 0 |
| 1 | apple | 1 |
| 1 | pear | 2 |
+------+--------+-------+
9
option.

mongosqld --schemaSource sampleDb

47

Để biết thêm thông tin về việc định cấu hình chế độ mẫu, hãy xem biểu đồ tham chiếu chế độ lấy mẫu.

mysql> select * from test;
+------+------+
| _id | a |
+------+------+
| 1 | 3 |
+------+------+
mysql> select * from test_b;
+------+--------+-------+
| _id | b | b_idx |
+------+--------+-------+
| 1 | orange | 0 |
| 1 | apple | 1 |
| 1 | pear | 2 |
+------+--------+-------+
9 database after the BI Connector samples the schema on startup.

Quan trọng

mongosqld --schemaSource sampleDb

30Deprecated kể từ phiên bản 2.2.Sampling Mode Reference Chart.

Sử dụng
mysql> select * from test;
+------+------+
| _id | a |
+------+------+
| 1 | 3 |
+------+------+
mysql> select * from test_b;
+------+--------+-------+
| _id | b | b_idx |
+------+--------+-------+
| 1 | orange | 0 |
| 1 | apple | 1 |
| 1 | pear | 2 |
+------+--------+-------+
4 thay thế.

Default: 1000

Mới trong phiên bản 2.3.

mongosqld --schemaSource sampleDb

32New trong phiên bản 2.5.

mysql> select * from test;
+------+------+
| _id | a |
+------+------+
| 1 | 3 |
+------+------+
mysql> select * from test_b;
+------+--------+-------+
| _id | b | b_idx |
+------+--------+-------+
| 1 | orange | 0 |
| 1 | apple | 1 |
| 1 | pear | 2 |
+------+--------+-------+
5 Chỉ định cơ sở dữ liệu và bộ sưu tập để bao gồm hoặc loại trừ khỏi quy trình lấy mẫu dữ liệu tạo ra lược đồ. Cũng có thể chỉ định nhiều bộ sưu tập từ một cơ sở dữ liệu hoặc nhiều bộ sưu tập từ nhiều cơ sở dữ liệu. Xem ví dụ dưới đây.

mongosqld --schemaSource sampleDb

65
to

mongosqld --schemaSource sampleDb

66 to include all documents in the specified namespace when building the schema. If you do not specify a namespace, setting

mongosqld --schemaSource sampleDb

65
to

mongosqld --schemaSource sampleDb

66 causes

mongosqld --mongo-uri "mongodb://:/?connect=direct"

9
to consider all documents in all databases [excluding
mysql> select * from test;
+------+------+
| _id | a |
+------+------+
| 1 | 3 |
+------+------+
mysql> select * from test_b;
+------+--------+-------+
| _id | b | b_idx |
+------+--------+-------+
| 1 | orange | 0 |
| 1 | apple | 1 |
| 1 | pear | 2 |
+------+--------+-------+
8,
mysql> select * from test;
+------+------+
| _id | a |
+------+------+
| 1 | 3 |
+------+------+
mysql> select * from test_b;
+------+--------+-------+
| _id | b | b_idx |
+------+--------+-------+
| 1 | orange | 0 |
| 1 | apple | 1 |
| 1 | pear | 2 |
+------+--------+-------+
7, and

mongosqld --schemaSource sampleDb

72] when building the schema. See an example below.

Nếu bạn không sử dụng tùy chọn
mysql> select * from test;
+------+------+
| _id | a |
+------+------+
| 1 | 3 |
+------+------+
mysql> select * from test_b;
+------+--------+-------+
| _id | b | b_idx |
+------+--------+-------+
| 1 | orange | 0 |
| 1 | apple | 1 |
| 1 | pear | 2 |
+------+--------+-------+
5 hoặc tùy chọn
mysql> select * from test;
+------+------+
| _id | a |
+------+------+
| 1 | 3 |
+------+------+
mysql> select * from test_b;
+------+--------+-------+
| _id | b | b_idx |
+------+--------+-------+
| 1 | orange | 0 |
| 1 | apple | 1 |
| 1 | pear | 2 |
+------+--------+-------+
4,

mongosqld --mongo-uri "mongodb://:/?connect=direct"

9 Dữ liệu mẫu từ tất cả các cơ sở dữ liệu và bộ sưu tập MongoDB có sẵn ngoại trừ cơ sở dữ liệu
mysql> select * from test;
+------+------+
| _id | a |
+------+------+
| 1 | 3 |
+------+------+
mysql> select * from test_b;
+------+--------+-------+
| _id | b | b_idx |
+------+--------+-------+
| 1 | orange | 0 |
| 1 | apple | 1 |
| 1 | pear | 2 |
+------+--------+-------+
7 và
mysql> select * from test;
+------+------+
| _id | a |
+------+------+
| 1 | 3 |
+------+------+
mysql> select * from test_b;
+------+--------+-------+
| _id | b | b_idx |
+------+--------+-------+
| 1 | orange | 0 |
| 1 | apple | 1 |
| 1 | pear | 2 |
+------+--------+-------+
8.

Default: 0

mongosqld --schemaSource sampleDb

39Default:

mongosqld --schemaSource sampleDb

40

Mới trong phiên bản 2.11.

mongosqld --mongo-uri "mongodb://:/?connect=direct"

9 re-samples data to create its schema. The default value is

mongosqld --schemaSource sampleDb

66, which means that after the initial sampling no re-sampling occurs for the duration of the connection. The specified value must be a positive integer.

Định cấu hình chế độ lấy mẫu của

mongosqld --mongo-uri "mongodb://:/?connect=direct"

9. Phải được sử dụng với tùy chọn
mysql> select * from test;
+------+------+
| _id | a |
+------+------+
| 1 | 3 |
+------+------+
mysql> select * from test_b;
+------+--------+-------+
| _id | b | b_idx |
+------+--------+-------+
| 1 | orange | 0 |
| 1 | apple | 1 |
| 1 | pear | 2 |
+------+--------+-------+
9. Các giá trị sau xác định hành vi lấy mẫu:

mongosqld --schemaSource sampleDb

43 Hành vi

Specify the encoding used to generate UUID binary subtype 3. Choose one of the following values:

  • mongosqld --mongo-uri "mongodb://:/?connect=direct"

    9 đọc một lược đồ được lưu trữ từ cơ sở dữ liệu MongoDB được chỉ định bởi tùy chọn
    mysql> select * from test;
    +------+------+
    | _id | a |
    +------+------+
    | 1 | 3 |
    +------+------+
    mysql> select * from test_b;
    +------+--------+-------+
    | _id | b | b_idx |
    +------+--------+-------+
    | 1 | orange | 0 |
    | 1 | apple | 1 |
    | 1 | pear | 2 |
    +------+--------+-------+
    9.

  • mongosqld --mongo-uri "mongodb://:/?connect=direct"

    9 lấy mẫu lược đồ và ghi dữ liệu lược đồ vào cơ sở dữ liệu MongoDB được chỉ định bởi tùy chọn
    mysql> select * from test;
    +------+------+
    | _id | a |
    +------+------+
    | 1 | 3 |
    +------+------+
    mysql> select * from test_b;
    +------+--------+-------+
    | _id | b | b_idx |
    +------+--------+-------+
    | 1 | orange | 0 |
    | 1 | apple | 1 |
    | 1 | pear | 2 |
    +------+--------+-------+
    9.

  • Để biết thêm thông tin về việc định cấu hình chế độ mẫu, hãy xem biểu đồ tham chiếu chế độ lấy mẫu.

Quan trọng

New in version 2.6.

mongosqld --schemaSource sampleDb

50New trong phiên bản 2.11.

Yêu cầu bất cứ khi nào

mongosqld --schemaSource sampleDb

43 được đặt. Chỉ định cơ sở dữ liệu nơi lưu trữ thông tin lược đồ.

{ "_id" : 1, "a" : 3, "b" : [ "orange", "apple", "pear" ] }

Ghi chú

mysql> select * from test;
+------+------+
| _id | a |
+------+------+
| 1 | 3 |
+------+------+
mysql> select * from test_b;
+------+--------+-------+
| _id | b | b_idx |
+------+--------+-------+
| 1 | orange | 0 |
| 1 | apple | 1 |
| 1 | pear | 2 |
+------+--------+-------+

Để tìm hiểu thêm về các chế độ lấy mẫu, hãy xem biểu đồ tham chiếu chế độ lấy mẫu.

mongosqld --schemaSource sampleDb

82 flag causes data from the

mongosqld --schemaSource sampleDb

85 column to be included in the

mongosqld --schemaSource sampleDb

86 table:

mysql> select * from test_b;
+------+------+--------+-------+
| _id | a | b | b_idx |
+------+------+--------+-------+
| 1 | 3 | orange | 0 |
| 1 | 3 | apple | 1 |
| 1 | 3 | pear | 2 |
+------+------+--------+-------+

mongosqld --schemaSource sampleDb

87Appends Đầu ra ghi nhật ký mới vào tệp nhật ký hiện có được chỉ định bởi

mongosqld --schemaSource sampleDb

88

Appends new logging output to an existing log file specified by

mongosqld --schemaSource sampleDb

88

Yêu cầu

mongosqld --schemaSource sampleDb

89

mongosqld --schemaSource sampleDb

89

mongosqld --schemaSource sampleDb

90Default: Stderr

Default: stderr

Chỉ định đường dẫn đến tệp nhật ký để lưu trữ đầu ra ghi nhật ký.

mongosqld --schemaSource sampleDb

91Default: Đổi tên

Default: rename

Chỉ định rằng bạn muốn xoay nhật ký và cách chúng nên được xoay.

Khi tùy chọn này được đặt, nhật ký xoay khi bạn cấp lệnh

mongosqld --schemaSource sampleDb

92 cho đầu nối MongoDB cho BI hoặc khi bạn khởi động lại

mongosqld --mongo-uri "mongodb://:/?connect=direct"

9.

Nếu bạn đặt

mongosqld --schemaSource sampleDb

89 thành ________ 195: Tệp nhật ký hiện tại được đóng. Một dấu thời gian được định dạng RFC3339 được thêm vào tệp nhật ký đóng. Một tệp nhật ký mới được tạo. Nếu bạn đặt

mongosqld --schemaSource sampleDb

89 thành ________ 197: Tệp nhật ký hiện tại được đóng và mở lại.RFC3339-formatted timestamp is appended to the closed log file. A new log file is created.If you set

mongosqld --schemaSource sampleDb

89 to

mongosqld --schemaSource sampleDb

97:The existing log file is closed and reopened.

Ghi chú

Trên các nền tảng Unix và MacOS, bạn có thể phát hành tín hiệu

mongosqld --schemaSource sampleDb

98 để khởi động lại quy trình

mongosqld --mongo-uri "mongodb://:/?connect=direct"

9 và xoay các bản ghi.

mongosqld --sampleNamespaces contacts.addresses

00Default: 60

Default: 60

Mới trong phiên bản 2.14.

Khoảng thời gian, tính bằng giây, tại đó thống kê sử dụng được ghi vào nhật ký. Đặt thành

mongosqld --schemaSource sampleDb

66 để tắt ghi nhật ký sử dụng.

Ghi chú

Trên các nền tảng Unix và MacOS, bạn có thể phát hành tín hiệu

mongosqld --schemaSource sampleDb

98 để khởi động lại quy trình

mongosqld --mongo-uri "mongodb://:/?connect=direct"

9 và xoay các bản ghi.

mongosqld --sampleNamespaces contacts.addresses

00Default: 60

Specifies that

mongosqld --mongo-uri "mongodb://:/?connect=direct"

9 should provide more detailed log output.

Mới trong phiên bản 2.14.

Khoảng thời gian, tính bằng giây, tại đó thống kê sử dụng được ghi vào nhật ký. Đặt thành

mongosqld --schemaSource sampleDb

66 để tắt ghi nhật ký sử dụng.

Ghi nhật ký sử dụng không được bật cho Windows.

mongosqld --sampleNamespaces contacts.addresses

02 chỉ định rằng

mongosqld --mongo-uri "mongodb://:/?connect=direct"

9 sẽ cung cấp đầu ra nhật ký chi tiết hơn.

mongosqld --sampleNamespaces contacts.addresses

04

Bảng sau đây mô tả thông tin được cung cấp ở mỗi cấp độ nhật ký:

Tùy chọn thư

Mức đăng nhập

Nội dung tin nhắn

Không có

mongosqld --mongo-uri "mongodb://:/?connect=direct"

9 events and state changes.

mongosqld --sampleNamespaces contacts.addresses

06

Đăng nhập không có gì.

Không có cờ

mongosqld --mongo-uri "mongodb://:/?connect=direct"

9 administrators.

mongosqld --sampleNamespaces contacts.addresses

08

Mặc định

Đăng nhập thông báo thông báo cho người dùng về các sự kiện

mongosqld --mongo-uri "mongodb://:/?connect=direct"

9 cơ bản và thay đổi trạng thái.

Người quản lý

Hides all log output.

Đăng nhập tin nhắn cung cấp thông tin cho quản trị viên

mongosqld --mongo-uri "mongodb://:/?connect=direct"

9.

Default: False

Nhà phát triển

mongosqld --mongo-uri "mongodb://:/?connect=direct"

9 to use TLS/SSL when connecting to a MongoDB instance.

Đăng nhập thông điệp hữu ích cho hỗ trợ và phát triển MongoDB.

Specifies the

mongosqld --sampleNamespaces contacts.addresses

13 file containing both the TLS/SSL certificate and key for

mongosqld --mongo-uri "mongodb://:/?connect=direct"

9
to use when connecting to MongoDB. You can specify the file name of the

mongosqld --sampleNamespaces contacts.addresses

13 file using either using a relative or absolute path.

mongosqld --sampleNamespaces contacts.addresses

04 trong khi tất cả đầu ra nhật ký.

mongosqld --schemaSource sampleDb

03
option to connect to a
mysql> select * from test;
+------+------+
| _id | a |
+------+------+
| 1 | 3 |
+------+------+
mysql> select * from test_b;
+------+--------+-------+
| _id | b | b_idx |
+------+--------+-------+
| 1 | orange | 0 |
| 1 | apple | 1 |
| 1 | pear | 2 |
+------+--------+-------+
1
or
mysql> select * from test;
+------+------+
| _id | a |
+------+------+
| 1 | 3 |
+------+------+
mysql> select * from test_b;
+------+--------+-------+
| _id | b | b_idx |
+------+--------+-------+
| 1 | orange | 0 |
| 1 | apple | 1 |
| 1 | pear | 2 |
+------+--------+-------+
2
that has

mongosqld --sampleNamespaces contacts.addresses

19
enabled without

mongosqld --sampleNamespaces contacts.addresses

20

mongosqld --schemaSource sampleDb

03Default: Sai

Specifies the path to a file containing the certificate and private key for connecting to MongoDB.

Hướng dẫn

mongosqld --mongo-uri "mongodb://:/?connect=direct"

9 sử dụng TLS/SSL khi kết nối với thể hiện MongoDB.

Permits

mongosqld --mongo-uri "mongodb://:/?connect=direct"

9 to connect to a MongoDB server whose hostname differs from the hostname on its TLS/SSL certificate.

mongosqld --sampleNamespaces contacts.addresses

12SPECECTION Tệp

mongosqld --sampleNamespaces contacts.addresses

13 chứa cả chứng chỉ TLS/SSL và khóa cho

mongosqld --mongo-uri "mongodb://:/?connect=direct"

9 để sử dụng khi kết nối với MongoDB. Bạn có thể chỉ định tên tệp của tệp

mongosqld --sampleNamespaces contacts.addresses

13 bằng cách sử dụng đường dẫn tương đối hoặc tuyệt đối.

Permits the MongoDB instance to present an invalid server SSL/TLS certificate. When using the

mongosqld --sampleNamespaces contacts.addresses

25 setting, MongoDB logs the use of the invalid certificate as a warning.

Tùy chọn này được yêu cầu khi sử dụng tùy chọn

mongosqld --schemaSource sampleDb

03 để kết nối với
mysql> select * from test;
+------+------+
| _id | a |
+------+------+
| 1 | 3 |
+------+------+
mysql> select * from test_b;
+------+--------+-------+
| _id | b | b_idx |
+------+--------+-------+
| 1 | orange | 0 |
| 1 | apple | 1 |
| 1 | pear | 2 |
+------+--------+-------+
1 hoặc
mysql> select * from test;
+------+------+
| _id | a |
+------+------+
| 1 | 3 |
+------+------+
mysql> select * from test_b;
+------+--------+-------+
| _id | b | b_idx |
+------+--------+-------+
| 1 | orange | 0 |
| 1 | apple | 1 |
| 1 | pear | 2 |
+------+--------+-------+
2 có

mongosqld --sampleNamespaces contacts.addresses

19 được bật mà không cần

mongosqld --sampleNamespaces contacts.addresses

20

Specifies the MongoDB instance's

mongosqld --sampleNamespaces contacts.addresses

13 file containing the root certificate chain from the Certificate Authority. Specify the file name of the

mongosqld --sampleNamespaces contacts.addresses

13 file using relative or absolute paths.

mongosqld --sampleNamespaces contacts.addresses

21 chỉ định đường dẫn đến một tệp chứa chứng chỉ và khóa riêng để kết nối với MongoDB.

mongosqld --sampleNamespaces contacts.addresses

222Permits

mongosqld --mongo-uri "mongodb://:/?connect=direct"

9 Để kết nối với máy chủ MongoDB có tên máy chủ khác với tên máy chủ trên chứng chỉ TLS/SSL của nó.

mongosqld --schemaSource sampleDb

03
] to
mysql> select * from test;
+------+------+
| _id | a |
+------+------+
| 1 | 3 |
+------+------+
mysql> select * from test_b;
+------+--------+-------+
| _id | b | b_idx |
+------+--------+-------+
| 1 | orange | 0 |
| 1 | apple | 1 |
| 1 | pear | 2 |
+------+--------+-------+
1
and
mysql> select * from test;
+------+------+
| _id | a |
+------+------+
| 1 | 3 |
+------+------+
mysql> select * from test_b;
+------+--------+-------+
| _id | b | b_idx |
+------+--------+-------+
| 1 | orange | 0 |
| 1 | apple | 1 |
| 1 | pear | 2 |
+------+--------+-------+
2
, if the

mongosqld --mongo-uri "mongodb://:/?connect=direct"

9
runs without the

mongosqld --sampleNamespaces contacts.addresses

33
,

mongosqld --mongo-uri "mongodb://:/?connect=direct"

9
will not attempt to validate the server certificates. This creates a vulnerability to expired
mysql> select * from test;
+------+------+
| _id | a |
+------+------+
| 1 | 3 |
+------+------+
mysql> select * from test_b;
+------+--------+-------+
| _id | b | b_idx |
+------+--------+-------+
| 1 | orange | 0 |
| 1 | apple | 1 |
| 1 | pear | 2 |
+------+--------+-------+
1
and
mysql> select * from test;
+------+------+
| _id | a |
+------+------+
| 1 | 3 |
+------+------+
mysql> select * from test_b;
+------+--------+-------+
| _id | b | b_idx |
+------+--------+-------+
| 1 | orange | 0 |
| 1 | apple | 1 |
| 1 | pear | 2 |
+------+--------+-------+
2
certificates as well as to foreign processes posing as valid
mysql> select * from test;
+------+------+
| _id | a |
+------+------+
| 1 | 3 |
+------+------+
mysql> select * from test_b;
+------+--------+-------+
| _id | b | b_idx |
+------+--------+-------+
| 1 | orange | 0 |
| 1 | apple | 1 |
| 1 | pear | 2 |
+------+--------+-------+
1
or
mysql> select * from test;
+------+------+
| _id | a |
+------+------+
| 1 | 3 |
+------+------+
mysql> select * from test_b;
+------+--------+-------+
| _id | b | b_idx |
+------+--------+-------+
| 1 | orange | 0 |
| 1 | apple | 1 |
| 1 | pear | 2 |
+------+--------+-------+
2
instances. Ensure that you always specify the CA file to validate the server certificates in cases where intrusion is a possibility.

mongosqld --sampleNamespaces contacts.addresses

24Permits phiên bản MongoDB để trình bày chứng chỉ SSL/TLS máy chủ không hợp lệ. Khi sử dụng cài đặt

mongosqld --sampleNamespaces contacts.addresses

25, MongoDB đã ghi lại việc sử dụng chứng chỉ không hợp lệ làm cảnh báo.

Specifies the MongoDB instance's

mongosqld --sampleNamespaces contacts.addresses

13 file containing the certificate revocation list.

mongosqld --sampleNamespaces contacts.addresses

26 Chỉ định tệp

mongosqld --sampleNamespaces contacts.addresses

13 của phiên bản MongoDB chứa chuỗi chứng chỉ gốc từ cơ quan chứng chỉ. Chỉ định tên tệp của tệp

mongosqld --sampleNamespaces contacts.addresses

13 bằng các đường dẫn tương đối hoặc tuyệt đối.

Enables FIPS mode in the installed OpenSSL library.

Cảnh báo

Default: TLS1_1

Đối với các kết nối SSL [

mongosqld --schemaSource sampleDb

03] đến
mysql> select * from test;
+------+------+
| _id | a |
+------+------+
| 1 | 3 |
+------+------+
mysql> select * from test_b;
+------+--------+-------+
| _id | b | b_idx |
+------+--------+-------+
| 1 | orange | 0 |
| 1 | apple | 1 |
| 1 | pear | 2 |
+------+--------+-------+
1 và
mysql> select * from test;
+------+------+
| _id | a |
+------+------+
| 1 | 3 |
+------+------+
mysql> select * from test_b;
+------+--------+-------+
| _id | b | b_idx |
+------+--------+-------+
| 1 | orange | 0 |
| 1 | apple | 1 |
| 1 | pear | 2 |
+------+--------+-------+
2, nếu

mongosqld --mongo-uri "mongodb://:/?connect=direct"

9 chạy mà không có

mongosqld --sampleNamespaces contacts.addresses

33,

mongosqld --mongo-uri "mongodb://:/?connect=direct"

9 sẽ không cố gắng xác nhận chứng chỉ máy chủ. Điều này tạo ra một lỗ hổng cho các chứng chỉ
mysql> select * from test;
+------+------+
| _id | a |
+------+------+
| 1 | 3 |
+------+------+
mysql> select * from test_b;
+------+--------+-------+
| _id | b | b_idx |
+------+--------+-------+
| 1 | orange | 0 |
| 1 | apple | 1 |
| 1 | pear | 2 |
+------+--------+-------+
1 và
mysql> select * from test;
+------+------+
| _id | a |
+------+------+
| 1 | 3 |
+------+------+
mysql> select * from test_b;
+------+--------+-------+
| _id | b | b_idx |
+------+--------+-------+
| 1 | orange | 0 |
| 1 | apple | 1 |
| 1 | pear | 2 |
+------+--------+-------+
2 hết hạn cũng như các quy trình nước ngoài đặt ra là các trường hợp hợp lệ
mysql> select * from test;
+------+------+
| _id | a |
+------+------+
| 1 | 3 |
+------+------+
mysql> select * from test_b;
+------+--------+-------+
| _id | b | b_idx |
+------+--------+-------+
| 1 | orange | 0 |
| 1 | apple | 1 |
| 1 | pear | 2 |
+------+--------+-------+
1 hoặc
mysql> select * from test;
+------+------+
| _id | a |
+------+------+
| 1 | 3 |
+------+------+
mysql> select * from test_b;
+------+--------+-------+
| _id | b | b_idx |
+------+--------+-------+
| 1 | orange | 0 |
| 1 | apple | 1 |
| 1 | pear | 2 |
+------+--------+-------+
2. Đảm bảo rằng bạn luôn chỉ định tệp CA để xác thực chứng chỉ máy chủ trong trường hợp xâm nhập là một khả năng.
mysql> select * from test;
+------+------+
| _id | a |
+------+------+
| 1 | 3 |
+------+------+
mysql> select * from test_b;
+------+--------+-------+
| _id | b | b_idx |
+------+--------+-------+
| 1 | orange | 0 |
| 1 | apple | 1 |
| 1 | pear | 2 |
+------+--------+-------+
1
or
mysql> select * from test;
+------+------+
| _id | a |
+------+------+
| 1 | 3 |
+------+------+
mysql> select * from test_b;
+------+--------+-------+
| _id | b | b_idx |
+------+--------+-------+
| 1 | orange | 0 |
| 1 | apple | 1 |
| 1 | pear | 2 |
+------+--------+-------+
2
. instance. The default value

mongosqld --sampleNamespaces contacts.addresses

45 corresponds to TLS version 1.1.

mongosqld --sampleNamespaces contacts.addresses

39 Chỉ định tệp

mongosqld --sampleNamespaces contacts.addresses

13 của phiên bản MongoDB chứa danh sách thu hồi chứng chỉ.

Default: disabled

mongosqld --sampleNamespaces contacts.addresses

41Enables Chế độ FOP trong thư viện OpenSSL đã cài đặt.

mongosqld --sampleNamespaces contacts.addresses

42Default: TLS1_1TLS/SSL for connections to mongosqld. The argument to the

mongosqld --sampleNamespaces contacts.addresses

47 option can be one of the following:

Chỉ định phiên bản TLS cần thiết tối thiểu cho các kết nối đi đến

mysql> select * from test;
+------+------+
| _id | a |
+------+------+
| 1 | 3 |
+------+------+
mysql> select * from test_b;
+------+--------+-------+
| _id | b | b_idx |
+------+--------+-------+
| 1 | orange | 0 |
| 1 | apple | 1 |
| 1 | pear | 2 |
+------+--------+-------+
1 hoặc
mysql> select * from test;
+------+------+
| _id | a |
+------+------+
| 1 | 3 |
+------+------+
mysql> select * from test_b;
+------+--------+-------+
| _id | b | b_idx |
+------+--------+-------+
| 1 | orange | 0 |
| 1 | apple | 1 |
| 1 | pear | 2 |
+------+--------+-------+
2. ví dụ. Giá trị mặc định

mongosqld --sampleNamespaces contacts.addresses

45 tương ứng với phiên bản TLS 1.1.

mongosqld --sampleNamespaces contacts.addresses

46Default: bị vô hiệu hóa

mongosqld --sampleNamespaces contacts.addresses

48

Mới trong phiên bản 2.3.

mongosqld --sampleNamespaces contacts.addresses

49

Bật hoặc tắt TLS/SSL cho các kết nối với MongoSQLD. Đối số cho tùy chọn

mongosqld --sampleNamespaces contacts.addresses

47 có thể là một trong những điều sau đây:

mongosqld --sampleNamespaces contacts.addresses

50

Giá trị

Sự mô tả

Specifies the

mongosqld --sampleNamespaces contacts.addresses

13 file containing both the TLS/SSL certificate and key for MySQL clients. Specify the file name of the

mongosqld --sampleNamespaces contacts.addresses

13 file using relative or absolute paths.

MongoSQLD không thể chấp nhận các kết nối được bảo mật bằng TLS/SSL.

Specifies the password used to decrypt the private key specified by

mongosqld --sampleNamespaces contacts.addresses

55

MongoSQLD có thể chấp nhận các kết nối được bảo mật bằng TLS/SSL.

Permits MySQL clients to present invalid client TLS/SSL certificates.

MongoSQLD chỉ có thể chấp nhận các kết nối được bảo mật bằng TLS/SSL.

Permits SQL clients to connect to a

mongosqld --mongo-uri "mongodb://:/?connect=direct"

9 whose hostname differs from the hostname on its TLS/SSL certificate.

mongosqld --sampleNamespaces contacts.addresses

59

mongosqld --sampleNamespaces contacts.addresses

51 chỉ định tệp

mongosqld --sampleNamespaces contacts.addresses

13 chứa cả chứng chỉ TLS/SSL và khóa cho máy khách MySQL. Chỉ định tên tệp của tệp

mongosqld --sampleNamespaces contacts.addresses

13 bằng các đường dẫn tương đối hoặc tuyệt đối.

mongosqld --mongo-uri "mongodb://:/?connect=direct"

9

mongosqld --sampleNamespaces contacts.addresses

13 file containing the root certificate chain from the Certificate Authority. Specify the file name of the

mongosqld --sampleNamespaces contacts.addresses

13 file using relative or absolute paths.

mongosqld --sampleNamespaces contacts.addresses

63 Chỉ định tệp

mongosqld --mongo-uri "mongodb://:/?connect=direct"

9

mongosqld --sampleNamespaces contacts.addresses

13 chứa danh sách thu hồi chứng chỉ.

Specifies the

mongosqld --mongo-uri "mongodb://:/?connect=direct"

9

mongosqld --sampleNamespaces contacts.addresses

13 file containing the certificate revocation list.

mongosqld --mongo-versionCompatibility 3.2

4Requires Xác thực cho các yêu cầu của khách hàng đến.

Requires authentication for incoming client requests.

Quan trọng

mongosqld --sampleNamespaces contacts.addresses

67Default: Quản trị viên

Default: admin

Chỉ định nguồn xác thực MongoDB mặc định. Đặt giá trị này để chỉ định một nguồn mặc định mà

mongosqld --mongo-uri "mongodb://:/?connect=direct"

9 sử dụng khi xác thực với cơ sở dữ liệu MongoDB. Các cơ chế xác thực

mongosqld --mongo-uri "mongodb://:/?connect=direct"

8 và

mongosqld --mongo-uri "mongodb://:/?connect=direct"

7 Sử dụng nguồn

mongosqld --mongo-versionCompatibility 3.2

9, trong khi

mongosqld --mongo-uri "mongodb://:/?connect=direct"

5 và

mongosqld --mongo-uri "mongodb://:/?connect=direct"

6 sử dụng cơ sở dữ liệu MongoDB làm nguồn của nó.

mongosqld --mongo-uri "mongodb://:/?connect=direct"

9
uses when authenticating with a MongoDB database. The authentication mechanisms

mongosqld --mongo-uri "mongodb://:/?connect=direct"

8 and

mongosqld --mongo-uri "mongodb://:/?connect=direct"

7 use the

mongosqld --mongo-versionCompatibility 3.2

9 source, while

mongosqld --mongo-uri "mongodb://:/?connect=direct"

5 and

mongosqld --mongo-uri "mongodb://:/?connect=direct"

6 use a MongoDB database as its source.

Nếu không có giá trị nào được đưa ra cho tùy chọn này, nó mặc định là cơ sở dữ liệu MongoDB

mysql> select * from test;
+------+------+
| _id | a |
+------+------+
| 1 | 3 |
+------+------+
mysql> select * from test_b;
+------+--------+-------+
| _id | b | b_idx |
+------+--------+-------+
| 1 | orange | 0 |
| 1 | apple | 1 |
| 1 | pear | 2 |
+------+--------+-------+
7.

Nguồn xác thực

mongosqld --mongo-versionCompatibility 3.2

9 lưu trữ một tham chiếu đến người dùng hệ thống trong cơ sở dữ liệu MongoDB có tên là

mongosqld --mongo-versionCompatibility 3.2

9, nhưng thông tin đăng nhập được lưu trữ trong một hệ thống bên ngoài, không phải là MongoDB, chẳng hạn như máy chủ LDAP.

Bất kỳ kết nối nào sử dụng giá trị mặc định đều có thể bỏ qua tham số

mongosqld --mongo-versionCompatibility 3.2

5 từ tên người dùng MySQL hoặc Tableau.

mongosqld --sampleNamespaces contacts.addresses

78Default: Scram-sha-1

Default: SCRAM-SHA-1

Chỉ định cơ chế xác thực mặc định. Đặt giá trị này để chỉ định một cơ chế mặc định để kết nối với

mongosqld --mongo-uri "mongodb://:/?connect=direct"

9. Bất kỳ kết nối nào sử dụng giá trị mặc định được chỉ định này có thể bỏ qua giá trị

{ "_id" : 1, "a" : 3, "b" : [ "orange", "apple", "pear" ] }

1 từ tên người dùng MySQL hoặc Tableau.

mongosqld --mongo-uri "mongodb://:/?connect=direct"

9
. Any connection which uses this specified default value can omit the

{ "_id" : 1, "a" : 3, "b" : [ "orange", "apple", "pear" ] }

1 value from its MySQL or Tableau username.

Giá trị

Sự mô tả

SCRAM-SHA-1

RFC 5802 Cơ chế xác thực phản ứng thách thức muối tiêu chuẩn sử dụng hàm băm SHA1. standard Salted Challenge Response Authentication Mechanism using the SHA1 hash function.

SCRAM-SHA-256

Mới trong Phiên bản 2.6: RFC 7677 Cơ chế xác thực phản ứng thách thức muối tiêu chuẩn sử dụng hàm băm SHA2.RFC 7677 standard Salted Challenge Response Authentication Mechanism using the SHA2 hash function.

Đồng bằng [LDAP SASL] [LDAP SASL]

Xác thực bên ngoài bằng LDAP. Bạn cũng có thể sử dụng

mongosqld --mongo-uri "mongodb://:/?connect=direct"

7 để xác thực người dùng trong cơ sở dữ liệu.

mongosqld --mongo-uri "mongodb://:/?connect=direct"

7 Truyền mật khẩu bằng văn bản đơn giản. Cơ chế này chỉ có sẵn trong MongoDB Enterprise.MongoDB Enterprise.

GSSAPI [Kerberos] [Kerberos]

Xác thực bên ngoài bằng cách sử dụng kerberos. Cơ chế này chỉ có sẵn trong MongoDB Enterprise.MongoDB Enterprise.

mongosqld --sampleNamespaces contacts.addresses

83Default: TLS1_1

Default: TLS1_1

Chỉ định phiên bản TLS yêu cầu tối thiểu để khách hàng kết nối với

mongosqld --mongo-uri "mongodb://:/?connect=direct"

9. Giá trị mặc định

mongosqld --sampleNamespaces contacts.addresses

45 tương ứng với phiên bản TLS 1.1.

mongosqld --mongo-uri "mongodb://:/?connect=direct"

9
. The default value

mongosqld --sampleNamespaces contacts.addresses

45 corresponds to TLS version 1.1.

mongosqld --sampleNamespaces contacts.addresses

86Name của dịch vụ hệ thống chạy

mongosqld --mongo-uri "mongodb://:/?connect=direct"

9

Name of the system service which runs

mongosqld --mongo-uri "mongodb://:/?connect=direct"

9

mongosqld --sampleNamespaces contacts.addresses

88Display Tên của dịch vụ hệ thống chạy

mongosqld --mongo-uri "mongodb://:/?connect=direct"

9

Display name of the system service which runs

mongosqld --mongo-uri "mongodb://:/?connect=direct"

9

mongosqld --sampleNamespaces contacts.addresses

90Descrip của dịch vụ hệ thống chạy

mongosqld --mongo-uri "mongodb://:/?connect=direct"

9

Description of the system service which runs

mongosqld --mongo-uri "mongodb://:/?connect=direct"

9

mongosqld --sampleNamespaces contacts.addresses

92Default: Địa chỉ IP đầu tiên cho

mongosqld --sampleNamespaces contacts.addresses

93

Default: First IP address for

mongosqld --sampleNamespaces contacts.addresses

93

Mới trong phiên bản 2.5.

Một FQDN cho mục đích cấu hình xác thực Kerberos. Tên máy chủ Kerberos chỉ ghi đè tên máy chủ cho cấu hình của Kerberos.FQDN for the purpose of configuring Kerberos authentication. The Kerberos hostname overrides the hostname only for the configuration of Kerberos.

mongosqld --sampleNamespaces contacts.addresses

94Default: MongoSQL

Default: mongosql

Mới trong phiên bản 2.5.

Một FQDN cho mục đích cấu hình xác thực Kerberos. Tên máy chủ Kerberos chỉ ghi đè tên máy chủ cho cấu hình của Kerberos.SPN, on a per-instance basis. If unspecified, the default value is used.

mongosqld --sampleNamespaces contacts.addresses

94Default: MongoSQL

Default: mongodb

Mới trong phiên bản 2.5.

Một FQDN cho mục đích cấu hình xác thực Kerberos. Tên máy chủ Kerberos chỉ ghi đè tên máy chủ cho cấu hình của Kerberos.SPN when connecting to Kerberized MongoDB instances. This value must match the service name set on MongoDB instances.

mongosqld --sampleNamespaces contacts.addresses

94Default: MongoSQL

Default: False

Tên đã đăng ký của dịch vụ bằng cách sử dụng Kerberos. Tùy chọn này cho phép bạn ghi đè thành phần tên dịch vụ Kerberos mặc định của Kerberos SPN, trên cơ sở trên cơ sở. Nếu không xác định, giá trị mặc định được sử dụng.

mongosqld --sampleNamespaces contacts.addresses

95Default: MongoDB

mongosqld --mongo-uri "mongodb://:/?connect=direct"

9
service credentials to be present in the client keytab as well as the service keytab. See Configure Kerberos for BI Connector for more information about Kerberos configuration.

Đặt Kerberos SPN khi kết nối với các trường hợp MongoDB Kerberized. Giá trị này phải khớp với tên dịch vụ được đặt trên các phiên bản MongoDB.

Default: 448

mongosqld --sampleNamespaces contacts.addresses

96Default: Sai

Mới trong phiên bản 2.11.

Disable listening on Unix domain sockets.

Sử dụng thông tin xác thực proxy cho ủy quyền của Kerbers, cho phép phái đoàn bị ràng buộc. Yêu cầu thông tin đăng nhập dịch vụ

mongosqld --mongo-uri "mongodb://:/?connect=direct"

9 phải có mặt trong KeyTab của Máy khách cũng như KeyTab Dịch vụ. Xem Cấu hình Kerberos cho đầu nối BI để biết thêm thông tin về cấu hình Kerberos.

Default: /tmp

mongosqld --sampleNamespaces contacts.addresses

98Default: 448

mongosqld --mongo-uri "mongodb://:/?connect=direct"

9
Unix domain socket.

Chỉ định các quyền cho tệp ổ cắm miền UNIX. will create a socket file called

mongosqld --mongo-uri "mongodb://:/?connect=direct"

03 underneath this path. If you do not specify

mongosqld --mongo-uri "mongodb://:/?connect=direct"

04
, the socket will exist at

mongosqld --mongo-uri "mongodb://:/?connect=direct"

05.

mongosqld --mongo-uri "mongodb://:/?connect=direct"

06

mongosqld --sampleNamespaces contacts.addresses

99disable Lắng nghe trên ổ cắm tên miền UNIX.

mongosqld --mongo-uri "mongodb://:/?connect=direct"

00Default: /TMP

Chỉ định một thư mục thay thế cho ổ cắm miền UNIX

mongosqld --mongo-uri "mongodb://:/?connect=direct"

9.

mongosqld --mongo-uri "mongodb://:/?connect=direct"

07

mongosqld --mongo-uri "mongodb://:/?connect=direct"

9 sẽ tạo một tệp ổ cắm có tên

mongosqld --mongo-uri "mongodb://:/?connect=direct"

03 bên dưới đường dẫn này. Nếu bạn không chỉ định

mongosqld --mongo-uri "mongodb://:/?connect=direct"

04, ổ cắm sẽ tồn tại tại

mongosqld --mongo-uri "mongodb://:/?connect=direct"

05.

Tham số

mongosqld --mongo-uri "mongodb://:/?connect=direct"

9 evaluates document fields that are specified with multiple data types. Accepted values are

mongosqld --mongo-uri "mongodb://:/?connect=direct"

09,

mongosqld --mongo-uri "mongodb://:/?connect=direct"

10, and

mongosqld --mongo-uri "mongodb://:/?connect=direct"

11. To learn more about these values, see System Variables.

mongosqld --mongo-uri "mongodb://:/?connect=direct"

12

mongosqld --mongo-uri "mongodb://:/?connect=direct"

9 sẽ tạo một tệp ổ cắm có tên

mongosqld --mongo-uri "mongodb://:/?connect=direct"

03 bên dưới đường dẫn này. Nếu bạn không chỉ định

mongosqld --mongo-uri "mongodb://:/?connect=direct"

04, ổ cắm sẽ tồn tại tại

mongosqld --mongo-uri "mongodb://:/?connect=direct"

05.

Tham số

mongosqld --mongo-uri "mongodb://:/?connect=direct"

9 uses to convert data types. BI Connector uses its own mode [

mongosqld --mongo-uri "mongodb://:/?connect=direct"

14] by default. Accepted values are

mongosqld --mongo-uri "mongodb://:/?connect=direct"

14 and

mongosqld --mongo-uri "mongodb://:/?connect=direct"

16. To learn more about these values, see System Variables.

Loại hình

mongosqld --mongo-uri "mongodb://:/?connect=direct"

9 and uses the

mongosqld --mongo-uri "mongodb://:/?connect=direct"

18 option to specify the type conversion mode:

mongosqld --setParameter "type_conversion_mode=mongosql"

Tương ứng với

mongosqld --mongo-uri "mongodb://:/?connect=direct"

9 using a YAML configuration file. This file may contain the settings listed in the following sections.

sợi dây

Xác định cách

mongosqld --mongo-uri "mongodb://:/?connect=direct"

9 đánh giá các trường tài liệu được chỉ định với nhiều loại dữ liệu. Các giá trị được chấp nhận là

mongosqld --mongo-uri "mongodb://:/?connect=direct"

09,

mongosqld --mongo-uri "mongodb://:/?connect=direct"

10 và

mongosqld --mongo-uri "mongodb://:/?connect=direct"

11. Để tìm hiểu thêm về các giá trị này, hãy xem các biến hệ thống.

Chỉ định chế độ

mongosqld --mongo-uri "mongodb://:/?connect=direct"

9 sử dụng để chuyển đổi các loại dữ liệu. Trình kết nối BI sử dụng chế độ riêng [

mongosqld --mongo-uri "mongodb://:/?connect=direct"

14] theo mặc định. Các giá trị được chấp nhận là

mongosqld --mongo-uri "mongodb://:/?connect=direct"

14 và

mongosqld --mongo-uri "mongodb://:/?connect=direct"

16. Để tìm hiểu thêm về các giá trị này, hãy xem các biến hệ thống.Externally Sourced Configuration File Values in the MongoDB manual.

systemLog:
logAppend:
logRotate: "rename"|"reopen"
path:
quiet:
verbosity:

mongosqld --schemaSource sampleDb

0

mongosqld --schemaSource sampleDb

1

mongosqld --schemaSource sampleDb

2

Quan trọng

Trình kết nối BI cung cấp các tùy chọn sau để kiểm soát lượng bộ nhớ hệ thống mà quá trình

mongosqld --mongo-uri "mongodb://:/?connect=direct"

9 có thể sử dụng để gửi truy vấn đến MongoDB. Các giới hạn này không bao gồm bộ nhớ mà Trình kết nối BI sử dụng cho các mục đích khác, chẳng hạn như chi phí cấu trúc dữ liệu, do đó, tổng số lượng bộ nhớ BI sử dụng sẽ cao hơn các giới hạn được đặt với các tùy chọn này.

mongosqld --mongo-uri "mongodb://:/?connect=direct"

9
process may use for sending queries to MongoDB. These limits do not include the memory which BI Connector uses for other purposes, such as data structure overhead, so the total amount of memory BI Connector uses will be higher than the limits set with these options.

mongosqld --mongo-uri "mongodb://:/?connect=direct"

21Type: Số nguyên

Type: integer

Mặc định: Không giới hạn

Chỉ định lượng bộ nhớ tối đa trong byte mà giai đoạn thực thi truy vấn có thể sử dụng.

mongosqld --mongo-uri "mongodb://:/?connect=direct"

222Type: Số nguyên

Type: integer

Mặc định: Không giới hạn

Chỉ định lượng bộ nhớ tối đa trong byte mà giai đoạn thực thi truy vấn có thể sử dụng.

mongosqld --mongo-uri "mongodb://:/?connect=direct"

222Type: Số nguyên

mongosqld --mongo-uri "mongodb://:/?connect=direct"

9
process may use.

Mới trong phiên bản 2.5.

Type: integer

Mặc định: Không giới hạn

Chỉ định lượng bộ nhớ tối đa trong byte mà giai đoạn thực thi truy vấn có thể sử dụng.

mongosqld --mongo-uri "mongodb://:/?connect=direct"

222Type: Số nguyên

mongosqld --mongo-uri "mongodb://:/?connect=direct"

9
client connection may use.

mongosqld --schemaSource sampleDb

3

mongosqld --schemaSource sampleDb

4

mongosqld --schemaSource sampleDb

5

mongosqld --schemaSource sampleDb

6

mongosqld --schemaSource sampleDb

7

Mới trong phiên bản 2.5.

Chỉ định lượng bộ nhớ tối đa trong byte mà quá trình

mongosqld --mongo-uri "mongodb://:/?connect=direct"

9 có thể sử dụng.

mongosqld --mongo-uri "mongodb://:/?connect=direct"

24TYPE: Số nguyên

mongosqld --mongo-uri "mongodb://:/?connect=direct"

26

Chỉ định lượng bộ nhớ tối đa trong byte mà kết nối máy khách

mongosqld --mongo-uri "mongodb://:/?connect=direct"

9 có thể sử dụng.

Tên

mongosqld --mongo-uri "mongodb://:/?connect=direct"

9 evaluates document fields that are specified with multiple data types. Accepted values are

mongosqld --mongo-uri "mongodb://:/?connect=direct"

09,

mongosqld --mongo-uri "mongodb://:/?connect=direct"

10, and

mongosqld --mongo-uri "mongodb://:/?connect=direct"

11. To learn more about these values, see System Variables.

mongosqld --mongo-uri "mongodb://:/?connect=direct"

31

Chỉ định lượng bộ nhớ tối đa trong byte mà kết nối máy khách

mongosqld --mongo-uri "mongodb://:/?connect=direct"

9 có thể sử dụng.

Tên

mongosqld --mongo-uri "mongodb://:/?connect=direct"

9 uses to convert data types. BI Connector uses its own mode [

mongosqld --mongo-uri "mongodb://:/?connect=direct"

14] by default. Accepted values are

mongosqld --mongo-uri "mongodb://:/?connect=direct"

14 and

mongosqld --mongo-uri "mongodb://:/?connect=direct"

16. To learn more about these values, see System Variables.

Loại hình

Tương ứng với

sợi dâyExternally Sourced Configuration File Values in the MongoDB manual.

Xác định cách

mongosqld --mongo-uri "mongodb://:/?connect=direct"

9 đánh giá các trường tài liệu được chỉ định với nhiều loại dữ liệu. Các giá trị được chấp nhận là

mongosqld --mongo-uri "mongodb://:/?connect=direct"

09,

mongosqld --mongo-uri "mongodb://:/?connect=direct"

10 và

mongosqld --mongo-uri "mongodb://:/?connect=direct"

11. Để tìm hiểu thêm về các giá trị này, hãy xem các biến hệ thống.

Chỉ định chế độ

mongosqld --mongo-uri "mongodb://:/?connect=direct"

9 sử dụng để chuyển đổi các loại dữ liệu. Trình kết nối BI sử dụng chế độ riêng [

mongosqld --mongo-uri "mongodb://:/?connect=direct"

14] theo mặc định. Các giá trị được chấp nhận là

mongosqld --mongo-uri "mongodb://:/?connect=direct"

14 và

mongosqld --mongo-uri "mongodb://:/?connect=direct"

16. Để tìm hiểu thêm về các giá trị này, hãy xem các biến hệ thống.

mongosqld --schemaSource sampleDb

8

Các tùy chọn tệp cấu hình này cũng có sẵn dưới dạng các biến hệ thống. Để biết thêm thông tin, xem các biến hệ thống.

mysql> select * from test;
+------+------+
| _id | a |
+------+------+
| 1 | 3 |
+------+------+
mysql> select * from test_b;
+------+--------+-------+
| _id | b | b_idx |
+------+--------+-------+
| 1 | orange | 0 |
| 1 | apple | 1 |
| 1 | pear | 2 |
+------+--------+-------+
4 option to specify a schema file for

mongosqld --mongo-uri "mongodb://:/?connect=direct"

9
to use.

mongosqld --schema /path/to/schema-file.drdl

Bạn có thể sử dụng các chỉ thị mở rộng trong tệp cấu hình của mình để tải các giá trị cấu hình có nguồn gốc từ bên ngoài. Chỉ thị mở rộng Thông tin bí mật tối nghĩa như chứng chỉ bảo mật và mật khẩu.

mysql> select * from test;
+------+------+
| _id | a |
+------+------+
| 1 | 3 |
+------+------+
mysql> select * from test_b;
+------+--------+-------+
| _id | b | b_idx |
+------+--------+-------+
| 1 | orange | 0 |
| 1 | apple | 1 |
| 1 | pear | 2 |
+------+--------+-------+
5 option to specify a database and collection for

mongosqld --mongo-uri "mongodb://:/?connect=direct"

9
to sample data from. If you start

mongosqld --mongo-uri "mongodb://:/?connect=direct"

9
without the
mysql> select * from test;
+------+------+
| _id | a |
+------+------+
| 1 | 3 |
+------+------+
mysql> select * from test_b;
+------+--------+-------+
| _id | b | b_idx |
+------+--------+-------+
| 1 | orange | 0 |
| 1 | apple | 1 |
| 1 | pear | 2 |
+------+--------+-------+
5
option, it samples data from all available databases except the
mysql> select * from test;
+------+------+
| _id | a |
+------+------+
| 1 | 3 |
+------+------+
mysql> select * from test_b;
+------+--------+-------+
| _id | b | b_idx |
+------+--------+-------+
| 1 | orange | 0 |
| 1 | apple | 1 |
| 1 | pear | 2 |
+------+--------+-------+
7 and
mysql> select * from test;
+------+------+
| _id | a |
+------+------+
| 1 | 3 |
+------+------+
mysql> select * from test_b;
+------+--------+-------+
| _id | b | b_idx |
+------+--------+-------+
| 1 | orange | 0 |
| 1 | apple | 1 |
| 1 | pear | 2 |
+------+--------+-------+
8 databases.

Để tìm hiểu thêm về việc sử dụng các chỉ thị mở rộng, hãy xem các giá trị tệp cấu hình có nguồn gốc từ bên ngoài trong hướng dẫn MongoDB.

mongosqld --sampleNamespaces contacts.addresses

Ghi chú

mysql> select * from test;
+------+------+
| _id | a |
+------+------+
| 1 | 3 |
+------+------+
mysql> select * from test_b;
+------+--------+-------+
| _id | b | b_idx |
+------+--------+-------+
| 1 | orange | 0 |
| 1 | apple | 1 |
| 1 | pear | 2 |
+------+--------+-------+
5 option with a wildcard [

mongosqld --mongo-uri "mongodb://:/?connect=direct"

47].

Các đường dẫn được sử dụng trong tệp cấu hình ví dụ này là cụ thể của Linux. Kiểm tra tài liệu hệ thống cục bộ của bạn để xác định các đường dẫn chính xác cho hệ thống của bạn.

mongosqld --sampleNamespaces contacts.addresses

1

Sử dụng tùy chọn

mysql> select * from test;
+------+------+
| _id | a |
+------+------+
| 1 | 3 |
+------+------+
mysql> select * from test_b;
+------+--------+-------+
| _id | b | b_idx |
+------+--------+-------+
| 1 | orange | 0 |
| 1 | apple | 1 |
| 1 | pear | 2 |
+------+--------+-------+
4 để chỉ định tệp lược đồ cho

mongosqld --mongo-uri "mongodb://:/?connect=direct"

9 để sử dụng.
mysql> select * from test;
+------+------+
| _id | a |
+------+------+
| 1 | 3 |
+------+------+
mysql> select * from test_b;
+------+--------+-------+
| _id | b | b_idx |
+------+--------+-------+
| 1 | orange | 0 |
| 1 | apple | 1 |
| 1 | pear | 2 |
+------+--------+-------+
5
at the command line to sample data from multiple collections within a database, or from multiple collections across several databases.

Sử dụng tùy chọn

mysql> select * from test;
+------+------+
| _id | a |
+------+------+
| 1 | 3 |
+------+------+
mysql> select * from test_b;
+------+--------+-------+
| _id | b | b_idx |
+------+--------+-------+
| 1 | orange | 0 |
| 1 | apple | 1 |
| 1 | pear | 2 |
+------+--------+-------+
5 để chỉ định cơ sở dữ liệu và bộ sưu tập cho

mongosqld --mongo-uri "mongodb://:/?connect=direct"

9 để lấy mẫu dữ liệu từ. Nếu bạn bắt đầu

mongosqld --mongo-uri "mongodb://:/?connect=direct"

9 mà không có tùy chọn
mysql> select * from test;
+------+------+
| _id | a |
+------+------+
| 1 | 3 |
+------+------+
mysql> select * from test_b;
+------+--------+-------+
| _id | b | b_idx |
+------+--------+-------+
| 1 | orange | 0 |
| 1 | apple | 1 |
| 1 | pear | 2 |
+------+--------+-------+
5, nó sẽ lấy mẫu dữ liệu từ tất cả các cơ sở dữ liệu có sẵn ngoại trừ cơ sở dữ liệu
mysql> select * from test;
+------+------+
| _id | a |
+------+------+
| 1 | 3 |
+------+------+
mysql> select * from test_b;
+------+--------+-------+
| _id | b | b_idx |
+------+--------+-------+
| 1 | orange | 0 |
| 1 | apple | 1 |
| 1 | pear | 2 |
+------+--------+-------+
7 và
mysql> select * from test;
+------+------+
| _id | a |
+------+------+
| 1 | 3 |
+------+------+
mysql> select * from test_b;
+------+--------+-------+
| _id | b | b_idx |
+------+--------+-------+
| 1 | orange | 0 |
| 1 | apple | 1 |
| 1 | pear | 2 |
+------+--------+-------+
8.

mongosqld --sampleNamespaces contacts.addresses

2

Ví dụ sau đây lấy mẫu dữ liệu từ bộ sưu tập có tên

mongosqld --mongo-uri "mongodb://:/?connect=direct"

44 trong cơ sở dữ liệu có tên

mongosqld --mongo-uri "mongodb://:/?connect=direct"

45:
mysql> select * from test;
+------+------+
| _id | a |
+------+------+
| 1 | 3 |
+------+------+
mysql> select * from test_b;
+------+--------+-------+
| _id | b | b_idx |
+------+--------+-------+
| 1 | orange | 0 |
| 1 | apple | 1 |
| 1 | pear | 2 |
+------+--------+-------+
5
options.

Để lấy mẫu dữ liệu từ tất cả các bộ sưu tập trong cơ sở dữ liệu, hãy sử dụng tùy chọn

mysql> select * from test;
+------+------+
| _id | a |
+------+------+
| 1 | 3 |
+------+------+
mysql> select * from test_b;
+------+--------+-------+
| _id | b | b_idx |
+------+--------+-------+
| 1 | orange | 0 |
| 1 | apple | 1 |
| 1 | pear | 2 |
+------+--------+-------+
5 với ký tự đại diện [

mongosqld --mongo-uri "mongodb://:/?connect=direct"

47].

mongosqld --sampleNamespaces contacts.addresses

3

Xác định cách

mongosqld --mongo-uri "mongodb://:/?connect=direct"

9 đánh giá các trường tài liệu được chỉ định với nhiều loại dữ liệu. Các giá trị được chấp nhận là

mongosqld --mongo-uri "mongodb://:/?connect=direct"

09,

mongosqld --mongo-uri "mongodb://:/?connect=direct"

10 và

mongosqld --mongo-uri "mongodb://:/?connect=direct"

11. Để tìm hiểu thêm về các giá trị này, hãy xem các biến hệ thống.

Chỉ định chế độ

mongosqld --mongo-uri "mongodb://:/?connect=direct"

9 sử dụng để chuyển đổi các loại dữ liệu. Trình kết nối BI sử dụng chế độ riêng [

mongosqld --mongo-uri "mongodb://:/?connect=direct"

14] theo mặc định. Các giá trị được chấp nhận là

mongosqld --mongo-uri "mongodb://:/?connect=direct"

14 và

mongosqld --mongo-uri "mongodb://:/?connect=direct"

16. Để tìm hiểu thêm về các giá trị này, hãy xem các biến hệ thống.

Các tùy chọn tệp cấu hình này cũng có sẵn dưới dạng các biến hệ thống. Để biết thêm thông tin, xem các biến hệ thống.

mongosqld --sampleNamespaces contacts.addresses

4

Bạn có thể sử dụng các chỉ thị mở rộng trong tệp cấu hình của mình để tải các giá trị cấu hình có nguồn gốc từ bên ngoài. Chỉ thị mở rộng Thông tin bí mật tối nghĩa như chứng chỉ bảo mật và mật khẩu.

mongosqld --sampleNamespaces contacts.addresses

5

Để tìm hiểu thêm về việc sử dụng các chỉ thị mở rộng, hãy xem các giá trị tệp cấu hình có nguồn gốc từ bên ngoài trong hướng dẫn MongoDB.

mongosqld --schemaSource sampleDb

65 option to

mongosqld --schemaSource sampleDb

66. This causes

mongosqld --mongo-uri "mongodb://:/?connect=direct"

9
to examine all documents in the specified

mongosqld --mongo-uri "mongodb://:/?connect=direct"

65
when it builds its schema.

Ghi chú

mongosqld --mongo-uri "mongodb://:/?connect=direct"

9 to build the schema based on all documents in the

mongosqld --mongo-uri "mongodb://:/?connect=direct"

67 namespace.

mongosqld --sampleNamespaces contacts.addresses

6

Các đường dẫn được sử dụng trong tệp cấu hình ví dụ này là cụ thể của Linux. Kiểm tra tài liệu hệ thống cục bộ của bạn để xác định các đường dẫn chính xác cho hệ thống của bạn.

mysql> select * from test;
+------+------+
| _id | a |
+------+------+
| 1 | 3 |
+------+------+
mysql> select * from test_b;
+------+--------+-------+
| _id | b | b_idx |
+------+--------+-------+
| 1 | orange | 0 |
| 1 | apple | 1 |
| 1 | pear | 2 |
+------+--------+-------+
9 option to specify a database in which to store schema information. Use the

mongosqld --schemaSource sampleDb

43
option to specify whether

mongosqld --mongo-uri "mongodb://:/?connect=direct"

9
can write to the schema database or only read from it.

Sử dụng tùy chọn

mysql> select * from test;
+------+------+
| _id | a |
+------+------+
| 1 | 3 |
+------+------+
mysql> select * from test_b;
+------+--------+-------+
| _id | b | b_idx |
+------+--------+-------+
| 1 | orange | 0 |
| 1 | apple | 1 |
| 1 | pear | 2 |
+------+--------+-------+
4 để chỉ định tệp lược đồ cho

mongosqld --mongo-uri "mongodb://:/?connect=direct"

9 để sử dụng.

mongosqld --schemaSource sampleDb

43
to

mongosqld --schemaSource sampleDb

47.

Sử dụng tùy chọn

mysql> select * from test;
+------+------+
| _id | a |
+------+------+
| 1 | 3 |
+------+------+
mysql> select * from test_b;
+------+--------+-------+
| _id | b | b_idx |
+------+--------+-------+
| 1 | orange | 0 |
| 1 | apple | 1 |
| 1 | pear | 2 |
+------+--------+-------+
5 để chỉ định cơ sở dữ liệu và bộ sưu tập cho

mongosqld --mongo-uri "mongodb://:/?connect=direct"

9 để lấy mẫu dữ liệu từ. Nếu bạn bắt đầu

mongosqld --mongo-uri "mongodb://:/?connect=direct"

9 mà không có tùy chọn
mysql> select * from test;
+------+------+
| _id | a |
+------+------+
| 1 | 3 |
+------+------+
mysql> select * from test_b;
+------+--------+-------+
| _id | b | b_idx |
+------+--------+-------+
| 1 | orange | 0 |
| 1 | apple | 1 |
| 1 | pear | 2 |
+------+--------+-------+
5, nó sẽ lấy mẫu dữ liệu từ tất cả các cơ sở dữ liệu có sẵn ngoại trừ cơ sở dữ liệu
mysql> select * from test;
+------+------+
| _id | a |
+------+------+
| 1 | 3 |
+------+------+
mysql> select * from test_b;
+------+--------+-------+
| _id | b | b_idx |
+------+--------+-------+
| 1 | orange | 0 |
| 1 | apple | 1 |
| 1 | pear | 2 |
+------+--------+-------+
7 và
mysql> select * from test;
+------+------+
| _id | a |
+------+------+
| 1 | 3 |
+------+------+
mysql> select * from test_b;
+------+--------+-------+
| _id | b | b_idx |
+------+--------+-------+
| 1 | orange | 0 |
| 1 | apple | 1 |
| 1 | pear | 2 |
+------+--------+-------+
8.

Ví dụ sau đây lấy mẫu dữ liệu từ bộ sưu tập có tên

mongosqld --mongo-uri "mongodb://:/?connect=direct"

44 trong cơ sở dữ liệu có tên

mongosqld --mongo-uri "mongodb://:/?connect=direct"

45:

Sử dụng tùy chọn

mongosqld --schemaSource sampleDb

75 để chỉ định khoảng thời gian tính bằng giây cho

mongosqld --mongo-uri "mongodb://:/?connect=direct"

9 để lấy mẫu dữ liệu và tái tạo lược đồ. Giá trị mặc định cho tùy chọn này là

mongosqld --schemaSource sampleDb

66, điều đó có nghĩa là

mongosqld --mongo-uri "mongodb://:/?connect=direct"

9 không bao giờ gọi lại dữ liệu.

mongosqld --schemaSource sampleDb

75
option to specify an interval in seconds for

mongosqld --mongo-uri "mongodb://:/?connect=direct"

9
to resample data and regenerate the schema. The default value for this option is

mongosqld --schemaSource sampleDb

66, which means that

mongosqld --mongo-uri "mongodb://:/?connect=direct"

9
never resamples data.

Nếu bạn đặt khoảng thời gian lấy mẫu lại với

mongosqld --schemaSource sampleDb

75 và bạn chỉ định cơ sở dữ liệu lược đồ với
mysql> select * from test;
+------+------+
| _id | a |
+------+------+
| 1 | 3 |
+------+------+
mysql> select * from test_b;
+------+--------+-------+
| _id | b | b_idx |
+------+--------+-------+
| 1 | orange | 0 |
| 1 | apple | 1 |
| 1 | pear | 2 |
+------+--------+-------+
9, bạn không thể đặt

mongosqld --schemaSource sampleDb

43 thành

mongosqld --schemaSource sampleDb

40.

mongosqld --schemaSource sampleDb

75
and you specify a schema database with
mysql> select * from test;
+------+------+
| _id | a |
+------+------+
| 1 | 3 |
+------+------+
mysql> select * from test_b;
+------+--------+-------+
| _id | b | b_idx |
+------+--------+-------+
| 1 | orange | 0 |
| 1 | apple | 1 |
| 1 | pear | 2 |
+------+--------+-------+
9
, you cannot set

mongosqld --schemaSource sampleDb

43
to

mongosqld --schemaSource sampleDb

40.

Ví dụ sau không chỉ định cơ sở dữ liệu lược đồ hoặc tệp lược đồ, do đó, nó giữ lược đồ của nó trong bộ nhớ. Nó sử dụng

mongosqld --schemaSource sampleDb

75 để chỉ định khoảng thời gian lấy mẫu dữ liệu là 3600 giây.

mongosqld --schemaSource sampleDb

75
to specify a data resampling interval of 3600 seconds.

mongosqld --sampleNamespaces contacts.addresses

8

Để kết nối

mongosqld --mongo-uri "mongodb://:/?connect=direct"

9 với phiên bản MongoDB đang chạy với xác thực được bật, hãy sử dụng tùy chọn

mongosqld --mongo-versionCompatibility 3.2

4 và cung cấp thông tin đăng nhập người dùng MongoDB.

mongosqld --mongo-uri "mongodb://:/?connect=direct"

9
to a MongoDB instance running with authentication enabled, use the

mongosqld --mongo-versionCompatibility 3.2

4
option and provide MongoDB user credentials.

Ví dụ sau đây bắt đầu

mongosqld --mongo-uri "mongodb://:/?connect=direct"

9 với thông tin đăng nhập cho người dùng có tên

mongosqld --mongo-uri "mongodb://:/?connect=direct"

86 với mật khẩu

mongosqld --mongo-uri "mongodb://:/?connect=direct"

87, người có quyền truy cập vào không gian tên

mongosqld --mongo-uri "mongodb://:/?connect=direct"

88.

mongosqld --mongo-uri "mongodb://:/?connect=direct"

9
with credentials for a user named

mongosqld --mongo-uri "mongodb://:/?connect=direct"

86 with password

mongosqld --mongo-uri "mongodb://:/?connect=direct"

87, who has access to the

mongosqld --mongo-uri "mongodb://:/?connect=direct"

88 namespace.

mongosqld --sampleNamespaces contacts.addresses

9

Ví dụ này không chỉ định cơ sở dữ liệu xác thực với tùy chọn

mongosqld --mongo-uri "mongodb://:/?connect=direct"

89, do đó, nó mặc định là
mysql> select * from test;
+------+------+
| _id | a |
+------+------+
| 1 | 3 |
+------+------+
mysql> select * from test_b;
+------+--------+-------+
| _id | b | b_idx |
+------+--------+-------+
| 1 | orange | 0 |
| 1 | apple | 1 |
| 1 | pear | 2 |
+------+--------+-------+
7. Nó không chỉ định một cơ chế xác thực với tùy chọn

mongosqld --mongo-uri "mongodb://:/?connect=direct"

91, do đó, nó mặc định là

mongosqld --mongo-uri "mongodb://:/?connect=direct"

5.

mongosqld --mongo-uri "mongodb://:/?connect=direct"

89
option, so it defaults to
mysql> select * from test;
+------+------+
| _id | a |
+------+------+
| 1 | 3 |
+------+------+
mysql> select * from test_b;
+------+--------+-------+
| _id | b | b_idx |
+------+--------+-------+
| 1 | orange | 0 |
| 1 | apple | 1 |
| 1 | pear | 2 |
+------+--------+-------+
7. It does not specify an authentication mechanism with the

mongosqld --mongo-uri "mongodb://:/?connect=direct"

91
option, so it defaults to

mongosqld --mongo-uri "mongodb://:/?connect=direct"

5.

Nếu bạn muốn chỉ định tệp cấu hình lưu nhật ký vào

mongosqld --mongo-uri "mongodb://:/?connect=direct"

93 và tải lược đồ từ

mongosqld --mongo-uri "mongodb://:/?connect=direct"

94, bạn có thể lưu một tệp như sau vào

mongosqld --mongo-uri "mongodb://:/?connect=direct"

95:

Cảnh báo

Tất cả các đường dẫn được chỉ định trong tệp cấu hình phải là tuyệt đối, ví dụ: Họ phải bắt đầu với

mongosqld --mongo-uri "mongodb://:/?connect=direct"

96.

mongosqld --mongo-uri "mongodb://:/?connect=direct"

0

Sau đó, bạn có thể bắt đầu

mongosqld --mongo-uri "mongodb://:/?connect=direct"

9 với tùy chọn

mongosqld --mongo-uri "mongodb://:/?connect=direct"

98:

mongosqld --mongo-uri "mongodb://:/?connect=direct"

9
with the

mongosqld --mongo-uri "mongodb://:/?connect=direct"

98
option:

mongosqld --mongo-uri "mongodb://:/?connect=direct"

1

Để biết thêm thông tin về việc bắt đầu

mongosqld --mongo-uri "mongodb://:/?connect=direct"

9 dưới dạng dịch vụ hệ thống, hãy xem Hướng dẫn cài đặt cho hệ điều hành của bạn.

Atlas là một dịch vụ đám mây để chạy, giám sát và duy trì triển khai MongoDB, bao gồm cả việc cung cấp các máy chủ chuyên dụng cho các trường hợp MongoDB. is a cloud service for running, monitoring, and maintaining MongoDB deployments, including the provisioning of dedicated servers for the MongoDB instances.

Atlas sử dụng TLS/SSL để mã hóa các kết nối và thực thi xác thực theo mặc định.

Ghi chú

Với Cấp miễn phí MongoDB Atlas, Trình kết nối BI không thể chạy các đường ống tổng hợp bằng tùy chọn

mongosqld --mongo-versionCompatibility 3.2

00. Tùy chọn này cho phép các giai đoạn tổng hợp ghi dữ liệu dưới dạng tệp tạm thời vào đĩa. Để xem xét các ràng buộc cấp miễn phí của MongoDB Atlas, hãy xem Hướng dẫn Atlas MongoDB.MongoDB Atlas manual.

mongosqld --mongo-uri "mongodb://:/?connect=direct"

9 có thể sử dụng bất kỳ chứng chỉ TLS hợp lệ nào được cấp bởi cơ quan chứng chỉ hoặc chứng chỉ tự ký. Nếu bạn sử dụng chứng chỉ tự ký, mặc dù kênh truyền thông sẽ được mã hóa, sẽ không có xác thực về nhận dạng máy chủ. Mặc dù một tình huống như vậy sẽ ngăn chặn sự nghe lén trên kết nối, nhưng nó khiến bạn dễ bị tấn công trong một cuộc tấn công trung gian. Sử dụng chứng chỉ được ký bởi cơ quan chứng chỉ đáng tin cậy sẽ cho phép khách hàng MySQL của bạn xác minh danh tính của máy chủ. can use any valid TLS certificate issued by a certificate authority, or a self-signed certificate. If you use a self-signed certificate, although the communications channel will be encrypted, there will be no validation of server identity. Although such a situation will prevent eavesdropping on the connection, it leaves you vulnerable to a man-in-the-middle attack. Using a certificate signed by a trusted certificate authority will permit your MySQL client to verify the server's identity.

Đối với mục đích thử nghiệm, bạn có thể tạo tệp khóa

mongosqld --mongo-versionCompatibility 3.2

02 có tên

mongosqld --mongo-versionCompatibility 3.2

03 bằng công cụ

mongosqld --mongo-versionCompatibility 3.2

04:

mongosqld --mongo-uri "mongodb://:/?connect=direct"

2

Bắt đầu

mongosqld --mongo-uri "mongodb://:/?connect=direct"

9 với các tùy chọn sau:

mongosqld --mongo-uri "mongodb://:/?connect=direct"

9
with the following options:

  • mongosqld --schemaSource sampleDb

    03

  • mongosqld --mongo-versionCompatibility 3.2

    4

  • mongosqld --sampleNamespaces contacts.addresses

    55

  • mongosqld --setParameter "type_conversion_mode=mongosql"

    9

  • mongosqld --mongo-versionCompatibility 3.2

    10

  • mongosqld --schemaSource sampleDb

    14

  • mongosqld --schemaSource sampleDb

    22

Nếu bạn đặt tên cho tệp khóa của mình

mongosqld --mongo-versionCompatibility 3.2

03 như trong ví dụ trước, bạn có thể chạy các mục sau, thay thế cho các thông tin đăng nhập và thông tin đăng nhập của bạn:

mongosqld --mongo-uri "mongodb://:/?connect=direct"

3

Chuyển tên người dùng, mật khẩu và cơ sở dữ liệu xác thực của bạn cho máy khách SQL của bạn. Ví dụ: sử dụng

mongosqld --mongo-uri "mongodb://:/?connect=direct"

16 mà không cần xác minh chứng chỉ máy chủ

mongosqld --mongo-uri "mongodb://:/?connect=direct"

9 của bạn:

mongosqld --mongo-uri "mongodb://:/?connect=direct"

9
server certificate:

mongosqld --mongo-uri "mongodb://:/?connect=direct"

4

Tham khảo Kết nối từ máy khách MySQL để biết thêm chi tiết về việc sử dụng ứng dụng khách

mongosqld --mongo-uri "mongodb://:/?connect=direct"

16 với Trình kết nối BI.

Biểu đồ dưới đây mô tả các loại cấu hình khởi động

mongosqld --mongo-uri "mongodb://:/?connect=direct"

9 và các tùy chọn được sử dụng với mỗi loại.

mongosqld --mongo-uri "mongodb://:/?connect=direct"

9
startup configurations and the options used with each.

Các cấu hình tùy chọn

mongosqld --mongo-uri "mongodb://:/?connect=direct"

9 sau đây không hợp lệ và gây ra lỗi khi khởi động.

mongosqld --mongo-uri "mongodb://:/?connect=direct"

9
option configurations are invalid and cause an error at startup.

Bài Viết Liên Quan

Chủ Đề