我不知道我的MySQL根密码;我怎么才能知道呢?是否有存储此密码的文件?
我正在跟踪这个链接,但我在本地没有directadmin目录。
我不知道我的MySQL根密码;我怎么才能知道呢?是否有存储此密码的文件?
我正在跟踪这个链接,但我在本地没有directadmin目录。
当前回答
你可以查看mysql根密码,好吧,我已经在mysql 5.5上尝试过了,所以不知道其他新版本是否工作良好
nano ~/.my.cnf
其他回答
系统:
中佐的Linux 7 位于华盛顿市郊1414区
过程:
Open two shell sessions, logging in to one as the Linux root user and the other as a nonroot user with access to the mysql command. In your root session, stop the normal mysqld listener and start a listener which bypasses password authentication (note: this is a significant security risk as anyone with access to the mysql command may access your databases without a password. You may want to close active shell sessions and/or disable shell access before doing this): # systemctl stop mysqld # /usr/sbin/mysqld --skip-grant-tables -u mysql & In your nonroot session, log in to mysql and set the mysql root password: $ mysql mysql> flush privileges; Query OK, 0 rows affected (0.00 sec) mysql> SET PASSWORD FOR 'root'@'localhost' = PASSWORD('MyNewPass'); Query OK, 0 rows affected, 1 warning (0.01 sec) mysql> quit; In your root session, kill the passwordless instance of mysqld and restore the normal mysqld listener to service: # kill %1 # systemctl start mysqld In your nonroot session, test the new root password you configured above: $ mysql -u root -p Enter password: Welcome to the MySQL monitor. Commands end with ; or \g. ... mysql>
去phpMyAdmin > config.inc.php > $cfg['Servers'][$i]['password'] = ";
你找不到它。它存储在一个数据库中,您需要根密码才能访问该数据库,即使您以某种方式获得了访问权限,它也会使用单向散列进行散列。您可以重置:如何重置Root用户密码
在你的“主机名”中。在MySQL工作的数据文件夹中的err文件中,尝试寻找以以下开头的字符串:
“为roor@localhost生成临时密码”
你可以使用
less /mysql/data/dir/hostname.err
然后使用斜杠命令,后面跟着要查找的字符串
/"A temporary password"
然后按n,进入下一个结果。
mysql服务器安装后的默认密码是:mysql