php 无法登录到 phpmyadmin

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/4681350/
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-25 13:57:25  来源:igfitidea点击:

Can't login to phpmyadmin

phpmysqlphpmyadmincentos

提问by user1448260

I am new at linux but I beed phpmyadmin on my centos server. I did this:

我是 linux 新手,但我在我的 centos 服务器上使用了 phpmyadmin。我这样做了:

cd /var/www/html/ (document root of apache)
wget http://sourceforge.net/projects/phpmyadmin/path/to/latest/version
tar xvfz phpMyAdmin-3.3.9-all-languages.tar.gz 
mv phpMyAdmin-3.3.9-all-languages  phpmyadmin
rm phpMyAdmin-3.3.9-all-languages.tar.gz 
cd phpmyadmin/
cp config.sample.inc.php config.inc.php

When I go to www.$ip/phpmyadmin and I am presented with a login screen asking for username and password. How can I get these credentials to log in? I'd like to log in as root I guess. But I don't know how to setup a root account and create a password for root using the cli and mysql. Please help? Thanks.

当我访问 www.$ip/phpmyadmin 时,我会看到一个要求输入用户名和密码的登录屏幕。如何获取这些凭据以登录?我想我想以 root 身份登录。但我不知道如何使用 cli 和 mysql 设置 root 帐户并为 root 创建密码。请帮忙?谢谢。

回答by Nathan

To set the mysql root password try the following:

要设置 mysql root 密码,请尝试以下操作:

 $ mysqladmin -u root password NEWPASSWORD

If you've never set the mysql password before, you won't have a password yet. Also it's important to remember that the mysql root user and the system root user are different. (And they should have different passwords)

如果您之前从未设置过 mysql 密码,那么您还没有密码。同样重要的是要记住 mysql root 用户和系统 root 用户是不同的。(他们应该有不同的密码)

More information is available from here: http://www.cyberciti.biz/faq/mysql-change-root-password/

可从此处获得更多信息:http: //www.cyberciti.biz/faq/mysql-change-root-password/

回答by Bronek

I had a problem with making login by phpMyAdmin with new user which I was created in phpMyAdmin as root. I added the new user with all ALL PRIVILEGES and there was no effect.

我在使用我在 phpMyAdmin 中以 root 身份创建的新用户登录时遇到了问题。我添加了具有所有权限的新用户,但没有任何效果。

Finally, I created the new user by MySQL Command Line Shell and everything became all right.

最后,我通过 MySQL 命令行 Shell 创建了新用户,一切正常。

I did it by following commands:

我通过以下命令做到了:

GRANT ALL ON *.* TO 'new_username'@'localhost' IDENTIFIED BY 'password_for_new_user';

FLUSH PRIVILEGES;

I found the description HERE

我在这里找到了描述

回答by Eric Petroelje

You are logging in to MySQL through phpMyAdmin, so the username and password you use would be the MySQL username and password.

您通过 phpMyAdmin 登录 MySQL,因此您使用的用户名和密码将是 MySQL 用户名和密码。

回答by Geoffrey Wagner

From the default setup, it should be a username and password from the MySQL database itself. So if you have a user account for the MySQL database, use that.

从默认设置来看,它应该是来自 MySQL 数据库本身的用户名和密码。因此,如果您有 MySQL 数据库的用户帐户,请使用该帐户。