mysql - ubuntu 如何将用户更改为“mysql”
问题描述
我的环境
Ubuntu 20 mysql 8
我正在尝试做的事情
我正在阅读这篇文章来更改 mysql 的 root 密码。
https://dev.mysql.com/doc/refman/8.0/en/resetting-permissions.html
B.3.3.2.2 Resetting the Root Password: Unix and Unix-Like Systems
...
The instructions assume that you start the MySQL server from the Unix login account that you normally use for running it. For example, if you run the server using the mysql login account, you should log in as mysql before using the instructions.
所以它必须是一种将操作系统用户更改为“mysql”的方法
我做了什么
所以我做到了sudo paasswd mysql
。我设置了密码
和...cat /etc/shadow
mysql:<newly created hash>:18650:0:99999:7:::
我试过了su - mysql
su: warning: cannot change directory to /nonexistent: No such file or directory
并且没有改变用户。
问题
将操作系统用户更改为的适当方法是mysql
什么?
解决方案
推荐阅读
- reactjs - 无法将反应手风琴面板项目传递给操作调用
- java - Gui- 使对象按特定标准移动
- swift - Swift 4 如何将文本打印到标签
- python - 为什么 numpy 混合基本/高级索引取决于切片邻接?
- java - 在另一个线程中捕获库引发的异常(android)
- php - 如何在 Wordpress 中为自定义表格创建单个视图页面
- python - 通过 Django 网页执行循环 python 脚本
- qfiledialog - 无法使用 QFileDialog.getSaveFileName 保存为 csv
- python - pytorch 中的自适应池化如何工作?
- rust - 如何在不制作任何副本的情况下将 bytes::Bytes 转换为 &str?