如何在使用Ubuntu的本地浏览器中运行PHP

如何在使用Ubuntu的本地浏览器中运行PHP

问题描述:

我试图从XAMPP运行phpMyAdmin时出现此错误。在安装和运行XAMPP之前,在本机上安装了一个现有的mysql安装程序。当我启动XAMPP时,mysql和apache2都成功启动。我可以用PHP脚本访问mysql数据库,但不能通过phpmyadmin访问。如何在使用Ubuntu的本地浏览器中运行PHP

Error 

MySQL said: Documentation 
#1045 - Access denied for user 'root'@'localhost' (using password: NO) 
phpMyAdmin tried to connect to the MySQL server, and the server rejected the connection. 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. 
+2

有你的phpMyAdmin的配置文件(配置设置正确的用户名和密码。 inc.php)? – ipsum 2010-10-04 19:39:23

您是否为root用户设置了密码?你不应该通过根连接,但检查。我还记得有一个版本的phpmyadmin出现问题,我不允许用root用户登录。

如果您要访问MySQL作为根没有密码,你/xampp/phpMyAdmin/config.inc.php文件确保下列变量被设置:

$cfg['Servers'][$i]['auth_type'] = 'config'; 
$cfg['Servers'][$i]['user'] = 'root'; 
$cfg['Servers'][$i]['password'] = ''; 
$cfg['Servers'][$i]['AllowNoPasswordRoot'] = true;