mysql - 在本地主机之外时,PHPMyAdmin 无法再连接到 MySQL

标签 mysql phpmyadmin easyphp

我有一个用 phpMyAdmin 管理的 MySQL 服务器。当它们都在 localhost 中时,即当 MySQL conf 文件读取时:

bind-address = 127.0.0.1

phpMyAdmin conf 文件显示为:

$cfg['Servers'][$i]['auth_type'] = 'config';
$cfg['Servers'][$i]['host'] = '127.0.0.1';
$cfg['Servers'][$i]['connect_type'] = 'tcp';
$cfg['Servers'][$i]['AllowNoPassword'] = true;

...然后它就可以正常工作了。但是,我的目标是能够从本地网络访问数据库,所以我将 MySQL 设置更改为:

bind-address = 192.168.56.1

(我的本地地址),并在 phpMyAdmin conf 文件中添加了一个新服务器列表:

$cfg['Servers'][$i]['auth_type'] = 'config';
$cfg['Servers'][$i]['host'] = '192.168.56.1';
$cfg['Servers'][$i]['connect_type'] = 'tcp';
$cfg['Servers'][$i]['AllowNoPassword'] = true;

但是当我尝试连接到那个服务器时,我得到这个错误:

#1045 - Access denied for user 'root'@'Tim-N550J' (using password: NO) 

我错过了什么?

最佳答案

您需要在 192.168.56.1 中启用来自 'root'@'Tim-N550J' 的外部连接!像这样

CREATE USER 'root'@'Tim-N550J' IDENTIFIED BY 'some_pass';

及之后

GRANT ALL PRIVILEGES ON *.* TO 'root'@'Tim-N550J' WITH GRANT OPTION;

关于mysql - 在本地主机之外时,PHPMyAdmin 无法再连接到 MySQL,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/23703637/

相关文章:

mysql - 表中的示例通过输入长度超过20个字符的单词(在mysql中)

MySQL 获取 View 转储

phpmyadmin - phpmyadmin 中烦人的警告

mysql - phpMyAdmin 创建一个触发器,用于在不存在子行时删除父行

windows - 在本地主机上慢 Drupal | windows7 EasyPHP 64x

php - 无法建立连接,因为目标机器主动拒绝

java - 我需要了解如何从数据库中获取唯一的随机行

java - java中的Mysql语句未执行

php - 在phpmyadmin中将表的一列迁移到另一个表的列

mysql - 如何通过 EasyPHP DevServer 的命令行访问 MySQL