mysql 怎么看用户名和密码

坦白讲,在MySQL中直接查看用户名是非常简单的,但是密码是加密的,你甚至可能无法直接看到你设置的密码。
This question is complicated by the encryption method and reset mechanism.
我们先来说说最重要的事情。
MySQL uses encrypted storage, specifically scram-sha-2 5 6 , so when you run select user from mysql.user; you can see username, but select password in mysql.user;任何截短的弹簧。
还有一点,我们去年运行这个项目的时候,发现新创建的用户默认密码是空的,但是如果你自己修改的话,加密后的密码应该可以通过reset函数获取到。
还有另一个关键细节。
For example, if you fail to log in with the old password more than 6 times, MySQL will force you to reset your password. At that time, the system will generate a random password for you and then notify you.说实话,当时很混乱。
At first I thought I could export the encrypted string and resolve it myself, but later found out that was wrong.
等一下,还有一件事。
强密码策略不是随机设置的。
For example, MySQL requires passwords to be at least 8 characters long and must contain numbers, letters, and special characters.很多人不注意这一点。
It is recommended to try the reset process in a test environment before running, so as not to get stuck if you forget your password.

怎样找到mysql的用户名和密码

然后,您将看到 MySQL 中的所有选项:shikoni skedarin 和 konfigurimit、perdorni mjetet 和 menaxhimit dhe shkoni te linja 和 komandës。

先说最重要的配置文件my.cnf,这个文件在/etc/mysql/下面,打开看[mysqld]那块,përdorues=那一行是系统用户名,密码但基本不直接写,去年我们跑那个项目差点因为这个踩坑,默认插件可能会留下足迹。
thjeshtë,por mos e merrni seriozisht,madje edhe qentë e sigurisë nuk mund ta durojnë。

Ka një detaj tjetër që është shumë kritik.命令行是一场艰苦的战斗。
'root'@'localhost';能看权限,但密码还是玄学,显示的可能只是加密过的hash值,比如password_hash('1 2 3 4 5 6 ')这种. Mendova se mund ta zbuloja drejtpërdrejt në fillim, por më vonë gjeta diçka të gabuar.我想从 mysql.user 中选择所需的内容;查找用户列表。

Prisni、ka edhe një gjë、rivendosja 和 fjalëkalimit tuaj është gjëja më praktike。
Nëse as skedari i konfigurimit dhe as mjetet e menaxhimit nuk funksionojnë, NDRYSHO 'root'@'localhost' USER I IDENTIFIKUAR NGA 'newpass';通常可以救援。
Por për të qenë i sinqertë, është mjaft konfuze. Është më mirë të kopjoni të dhënat tuaja përpara përdorimit për të shmangur ndryshimin e të gjitha fjalëkalimeve në '1 2 3 4 5 6 '.