如何让phpMyAdmin连接到本地mysql服务器?

时间:2023-02-14 07:35:26

I have my config.inc.php file, and have set my host name to localhost. Unfortunately, I have no idea what my username/password should be. Is that something I need to configure on the MySql side? I tried creating an arbitrary username/password (admin/password), but when I try to log into phpMyAdmin with those credentials, I get an error: (#1045 - Access denied for user 'admin'@'localhost' (using password: YES))

我有我的config.inc.php文件,并将我的主机名设置为localhost。不幸的是,我不知道我的用户名/密码是什么。这是我需要在MySql端配置的东西吗?我尝试创建一个任意的用户名/密码(管理员/密码),但是当我尝试使用这些凭据登录phpMyAdmin时,我收到一个错误:(#1045 - 拒绝访问用户'admin'@'localhost'(使用密码:是))

Can anyone point me in the right direction? (Sorry for the dumb question; I just haven't had to install mysql before. I've always had a host name / username / password given to me.)

谁能指出我正确的方向? (抱歉这个愚蠢的问题;我之前没有安装过mysql。我总是有一个主机名/用户名/密码给我。)

Thanks!

4 个解决方案

#1


here you have the default privileges in mysql, and how to change them.

这里你有mysql的默认权限,以及如何更改它们。

http://dev.mysql.com/doc/refman/5.0/en/default-privileges.html

#2


What installation of mysql are you using? Without knowing that its very hard to know. I would recommend getting the wamp installation and remembering that the usual "normal" installation uses user name: root and no password

您正在使用什么样的mysql安装?不知道它很难知道。我建议获取wamp安装并记住通常的“正常”安装使用用户名:root和无密码

#3


root with no password.

root没有密码。

$cfg['Servers'][$i]['user'] = 'root'; // MySQL user $cfg['Servers'][$i]['password'] = ''; // MySQL password (only needed

$ cfg ['Servers'] [$ i] ['user'] ='root'; // MySQL用户$ cfg ['Servers'] [$ i] ['password'] =''; // MySQL密码(仅需要

#4


I had this problem before, you need to go and look up the password in the config files yourself, since phpMyAdmin's interface will hide the password from you. It's a pain... unfortunately I'm too lazy to install it myself and find exactly where it is for you.

我以前遇到过这个问题,你需要自己去配置文件中查找密码,因为phpMyAdmin的界面会隐藏你的密码。这是一种痛苦......不幸的是,我懒得自己安装它并找到它的确切位置。

#1


here you have the default privileges in mysql, and how to change them.

这里你有mysql的默认权限,以及如何更改它们。

http://dev.mysql.com/doc/refman/5.0/en/default-privileges.html

#2


What installation of mysql are you using? Without knowing that its very hard to know. I would recommend getting the wamp installation and remembering that the usual "normal" installation uses user name: root and no password

您正在使用什么样的mysql安装?不知道它很难知道。我建议获取wamp安装并记住通常的“正常”安装使用用户名:root和无密码

#3


root with no password.

root没有密码。

$cfg['Servers'][$i]['user'] = 'root'; // MySQL user $cfg['Servers'][$i]['password'] = ''; // MySQL password (only needed

$ cfg ['Servers'] [$ i] ['user'] ='root'; // MySQL用户$ cfg ['Servers'] [$ i] ['password'] =''; // MySQL密码(仅需要

#4


I had this problem before, you need to go and look up the password in the config files yourself, since phpMyAdmin's interface will hide the password from you. It's a pain... unfortunately I'm too lazy to install it myself and find exactly where it is for you.

我以前遇到过这个问题,你需要自己去配置文件中查找密码,因为phpMyAdmin的界面会隐藏你的密码。这是一种痛苦......不幸的是,我懒得自己安装它并找到它的确切位置。