Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

MongoDB assertion: 18 {code: 18, ok: 0.0, errmsg: & quot;auth fails"}

2025-04-07 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Database >

Share

Shulou(Shulou.com)06/01 Report--

Assertion: 18 {code: 18, ok: 0.0, errmsg: "auth fails"}

MongoDB 2.4.10 uses the xucy administrator account under the admin database to export data and verification fails.

# mongoexport-uxucy-p-d Test-c Pro-f _ id,SK2,SK3-o / data/var/log/mongodb/pro.json connected to: 127.0.0.1 Enter password: assertion: 18 {code: 18, ok: 0.0, errmsg: "auth fails"}

Solution:

This appears after version 2.2.2. Refer to: https://jira.mongodb.org/browse/SERVER-9991

Verification parameters need to be added:

-- authenticationDatabase admin

Similar commands are mongodump, mongorestore, mongoexport, mongoimport

# mongoexport-- authenticationDatabase admin-uxucy-p-d Test-c Pro-f _ id,SK2,SK3-o / data/var/log/mongodb/pro.json connected to: 127.0.0.1 Enter password: exported 564097 records

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Database

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report