简体   繁体   English

xampp phpmyadmin不起作用

[英]xampp phpmyadmin doesn't work

2 messages occurring. 发生2条消息。

First one is: 第一个是:

MySQL said: Documentation MySQL说:文档

#1045 - Access denied for user 'root'@'localhost' (using password: NO) #1045-用户'root'@'localhost'的访问被拒绝(使用密码:否)

Second one is: 第二个是:

phpMyAdmin tried to connect to the MySQL server, and the server rejected the connection. phpMyAdmin尝试连接到MySQL服务器,服务器拒绝连接。 You should check the host, username and password in your configuration and make sure that they correspond to the information given by the administrator of the MySQL server. 您应该检查配置中的主机,用户名和密码,并确保它们与MySQL服务器管理员提供的信息相对应。

But I set password to mysql by command line. 但是我通过命令行将密码设置为mysql。

Since you update mysql user password from commandline, you have to change your config.inc.php file. 由于您是从命令行更新mysql用户密码的,因此您必须更改config.inc.php文件。 By default there won't be password given for root user in phpmyadmin config file. 默认情况下,phpmyadmin配置文件中不会为root用户提供密码。

You should change configuration in phpmyadmin config file to allow you to login using password. 您应该在phpmyadmin配置文件中更改配置,以允许您使用密码登录。

There will be config.inc.php in phpmyadmin directory. phpmyadmin目录中将有config.inc.php In that: 在那里面:

Method 1 : If you want phpMyAdmin to automatically login. 方法1:如果要phpMyAdmin自动登录。

/* Authentication type */
$cfg['Servers'][$i]['auth_type'] = 'config';
/* Server parameters */
$cfg['Servers'][$i]['AllowNoPassword'] = false;
$cfg['Servers'][$i]['user'] = 'root';
$cfg['Servers'][$i]['password'] = 'write_here_password';

If you, configure this way It won't ask you for password to access phpmyadmin. 如果您以这种方式进行配置,则不会要求您输入密码来访问phpmyadmin。 It will use password from config file. 它将使用配置文件中的密码。

Method 2 : If you want phpMyAdmin to show login screen and login manually. 方法2:如果要phpMyAdmin显示登录屏幕并手动登录。

/* Authentication type */
$cfg['Servers'][$i]['auth_type'] = 'cookie';
/* Server parameters */
$cfg['Servers'][$i]['AllowNoPassword'] = false;
$cfg['Servers'][$i]['user'] = 'root';
$cfg['Servers'][$i]['password'] = '';

This way, it will present you with login screen of phpMyAdmin where you can type username root and password for that user (the one you set from commandline). 这样,它将为您显示phpMyAdmin的登录屏幕,您可以在其中输入该用户的用户名root和密码(您从命令行设置的用户名)。

If you install Xampp you do not have to set a password. 如果安装Xampp,则不必设置密码。 sure its better if you do but to test if everything is right, you should not set one untill everyting works. 如果这样做可以确保更好,但要测试一切是否正确,则不应设置一切正常。

by default its: 默认情况下:

username: root 用户名:root

password: leave this empty 密码: leave this empty

your error 你的错误

1045 - Access denied for user 'root'@'localhost' (using password: NO) 1045-用户'root'@'localhost'的访问被拒绝(使用密码:否)

says that you try to connect to mysql with a password but the system dont want a password. 说您尝试使用密码连接到mysql,但是系统不需要密码。

either you have to edit the php config and set password usage or delete password via command line :) 您要么必须编辑php config并设置密码用法,要么通过命令行删除密码:)

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM