rabbitmq add user
时间: 2023-10-25 08:09:10 浏览: 132
To add a new user to RabbitMQ, you can follow these steps:
1. Open the RabbitMQ management console in your web browser.
2. Click on the "Admin" tab and then click on the "Add a user" button.
3. Enter a username and password for the new user.
4. Set any desired permissions for the user, such as read or write access to specific queues or exchanges.
5. Click on the "Add user" button to create the new user.
Alternatively, you can use the RabbitMQ command-line tool to add a user. Here's an example command to create a new user named "myuser" with a password of "mypassword":
```
rabbitmqctl add_user myuser mypassword
```
You can then set permissions for the user using the `rabbitmqctl set_permissions` command. For example, to give the "myuser" user read and write access to the "myqueue" queue, you could run:
```
rabbitmqctl set_permissions -p / myuser "myqueue" ".*" ".*"
```
This sets the permissions to allow the user to read and write messages to the "myqueue" queue.
阅读全文