mysql new user and permission refresh/server port opening issue/mongodb configuration file and set user permissions

Tip : This is my personal IT resource website, you can go in and have a look

The project went online last week. There were a lot of things. I have never come to write something urgently. I have a little time today, so let’s share with you some of the problems encountered when the project goes online. I hope you can refer to similar problems when you encounter similar problems. Solve it.
1. Generally, we will use Navicat as a client to connect to our mysql. Whether it is to open the mysql user table with Navicat to add a user or use the sql command to add a new user, we need to use the flush privileges command to refresh the permissions before it will take effect. ;
2. After we install the service on the server, we need to open the corresponding port for remote access. If the server firewall is not turned on, you can directly access it, but it is not recommended to turn off the firewall, but sometimes the firewall is turned on, and also open the need to access The port is still not accessible. In this case, the operator where the server is located may have a security group policy, and we need to add the port to the security group.
3. Mongodb configuration file content

#端口
port=27017
#数据库文件存放目录
dbpath=/home/***/mongodb/db
#日志文件存放路径
logpath=/home/***/mongodb/log/mongodb.log
#使用追加方式写日志
logappend=true
#以守护线程的方式运行,创建服务器进程
fork=true
#最大同时连接数
maxConns=100
#不启用验证
#noauth=true
#每次写入会记录一条操作日志
journal=true
#存储引擎有mmapv1、wiredTiger、mongorocks
storageEngine=wiredTiger
#访问IP
bind_ip=0.0.0.0
#用户验证
auth=true

Start command: mongod --config /home/***/mongodb/conf/mongodb.conf
set access permissions
switch to admin library
use admin
create user grant root permissions
db.createUser({user:"admin",pwd:"* 1ZszL#KRhwOg2Ms",roles:["root"]})
Log in to
db.auth("admin","*1ZszL#KRhwOg2Ms")
to write a little bit first, there is a pioneering work that will gradually improve the quality of the article, thank you for reading!
Recommend a good place to learn JAVA, there are many examples, easy to use, and practical projects such as microservices + VUE that everyone has been looking for
Insert picture description here

Guess you like

Origin blog.csdn.net/weixin_45345374/article/details/108577108