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

发布于 2024-09-26 12:48:42 字数 547 浏览 8 评论 0原文

当我尝试从 XAMPP 运行 phpMyAdmin 时,出现此错误。在我安装和运行 XAMPP 之前,这台机器上已经安装了 mysql。当我启动 XAMPP 时,mysql 和 apache2 都成功启动。我可以使用 PHP 脚本访问 mysql 数据库,但不能通过 phpmyadmin 访问。

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.

I'm getting this error when I attempt to run phpMyAdmin from XAMPP. There was an existing mysql installation on this machine previous to my installation and running of XAMPP. When I start XAMPP both mysql and apache2 start up successfully. I can access the mysql database with a PHP script but not through phpmyadmin.

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.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

爱给你人给你 2024-10-03 12:48:42

如果您想在没有密码的情况下以 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;

If you want to access mysql as root without a password, in your /xampp/phpMyAdmin/config.inc.php file ensure the following variables are being set:

$cfg['Servers'][$i]['auth_type'] = 'config';
$cfg['Servers'][$i]['user'] = 'root';
$cfg['Servers'][$i]['password'] = '';
$cfg['Servers'][$i]['AllowNoPasswordRoot'] = true;
对你的占有欲 2024-10-03 12:48:42

您是否为 root 用户设置了密码?您不应该通过 root 连接,但请检查一下。我还记得 phpmyadmin 的其中一个版本存在问题,不允许我使用 root 用户登录。

Do you have a password set for the root user? You shouldn't connect via root but check that. I also recall having issue with one of the version of phpmyadmin where I wasn't allowed to log in with the root user.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文