MySQL 如何找出mysql数据库的用户名和密码

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/2703996/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-08-31 15:52:47  来源:igfitidea点击:

How to find out the username and password for mysql database

mysqlpasswords

提问by Abhishek

I've forgotten what I set as username and password for mysqldatabase. How could I be able to find it out? I am using wamp server. I am a newbie in mysql.

我忘记了我为mysql数据库设置的用户名和密码。我怎么能查到呢?我正在使用 wamp 服务器。我是mysql.

回答by Fábio Antunes

Go to this file in: WampFolder\apps\phpmyadmin[phpmyadmin version]\config.inc.php

转到此文件: WampFolder\apps\phpmyadmin[phpmyadmin version]\config.inc.php

Usually wamp is in your main hard drive folder C:\wamp\

通常 wamp 位于您的主硬盘驱动器文件夹中 C:\wamp\

You will see something like:

你会看到类似的东西:

$cfg['Servers'][$i]['user'] = 'YOUR USER NAME IS HERE';
$cfg['Servers'][$i]['password'] = 'AND YOU PASSWORD IS HERE';

Try using the password and username that you have on that file.

尝试使用您在该文件上的密码和用户名。

回答by James Goodwin

Assuming that the user you are using in phpmyadmin has the necessary privileges, you can run this query to change the root password:

假设您在 phpmyadmin 中使用的用户具有必要的权限,您可以运行此查询来更改 root 密码:

UPDATE mysql.user SET Password=PASSWORD('MyNewPass') WHERE User='root';
FLUSH PRIVILEGES;

回答by Karthik

In your local system right,

在您的本地系统中,

   go to this url : http://localhost/phpmyadmin/

   In this click mysql default db, after that browser user table to get existing username and password.

回答by Rishi Tiwari

If you forget your password for SQL plus 10g then follow the steps :

如果您忘记了 SQL plus 10g 的密码,请按照以下步骤操作:

  1. START
  2. Type RUN in the search box
  3. Type 'cnc' in the box captioned as OPEN and a black box will appear 4.There will be some text already in the box. (C:\Users\admin>) Just beside that start typing 'sqlplus/nolog' press ENTER key
  4. On the next line type 'conn sys/change_on_install as sysdba' (press ENTER) 6.(in the next line after sql-> type) 'alter user scott account unlock' .
  5. Now open your slpplus and type user name as 'scott' and password as 'tiger'.
  1. 开始
  2. 在搜索框中输入 RUN
  3. 在标题为 OPEN 的框中键入“cnc”,将出现一个黑框 4. 框中已有一些文本。(C:\Users\admin>) 在旁边开始输入 'sqlplus/nolog' 按 ENTER 键
  4. 在下一行输入 'conn sys/change_on_install as sysdba'(按 ENTER) 6.(在 sql-> type 之后的下一行)'alter user scott account unlock' 。
  5. 现在打开您的 slpplus 并键入用户名“scott”和密码“tiger”。

If it asks your old password then type the one you have given while installing.

如果它询问您的旧密码,请输入您在安装时提供的密码。

回答by Amit Aggarwal

One of valid JDBC url is

有效的 JDBC url 之一是

jdbcUrl=jdbc:mysql://localhost:3306/wsmg?user=root&password=root

回答by Timothy

There are two easy ways:

有两种简单的方法:

  1. In your cpanel Go to cpanel/ softaculous/ wordpress, under the current installation, you will see the websites you have installed with the wordpress. Click the "edit detail" of the particular website and you will see your SQL database username and password.

  2. In your server Access your FTP and view the wp-config.php

  1. 在你的cpanel中去cpanel/softaculous/wordpress,在当前安装下,你会看到你用wordpress安装的网站。单击特定网站的“编辑详细信息”,您将看到您的 SQL 数据库用户名和密码。

  2. 在您的服务器中访问您的 FTP 并查看 wp-config.php

回答by Sarfraz

Open phpmyadmin, go to database and corresponding table to find it out.

打开phpmyadmin,到数据库和对应表中查找。