远程phpmyadmin无法登录,但mysql客户端可以登录 [英] remote phpmyadmin can't login but mysql client can
问题描述
我在Ubuntu 12.04 x64上有两台服务器:Web和MySQL
在Web上设置phpmyadmin安装和nginx等. 在MySQL上设置了mysqsl安装
当我从Web运行mysql --user = user --host = MySQL.hostname --password时,我可以很好地连接到MySQL服务器
但是当我尝试通过phpmyadmin连接时, 它不起作用.为什么?
用户不是root
在/usr/share/phpmyadmin/config.inc.php文件(该文件是我从示例中复制的)中,我有这个文件:
/*
* First server
*/
$i++;
/* Authentication type */
$cfg['Servers'][$i]['auth_type'] = 'cookie';
/* Server parameters */
$cfg['Servers'][$i]['host'] = 'MySQL.hostname';
$cfg['Servers'][$i]['connect_type'] = 'tcp';
$cfg['Servers'][$i]['compress'] = false;
/* Select mysql if your server does not have mysqli */
$cfg['Servers'][$i]['extension'] = 'mysqli';
$cfg['Servers'][$i]['AllowNoPassword'] = false;
在MySQL服务器上,我将其设置为绑定到0.0.0.0,并且我对此用户具有本地主机"和%"上的用户权限(请记住,我确实可以通过mysql客户端进行连接)
(注意:MySQL.hostname实际上是一个可解析的主机名,仅在此处使用它即可)
好的答案很简单,即使主文件位于/usr/share/phpmyadmin中,配置实际上也已加载到/etc/phpmyadmin/中. >
在那里更改config.inc.php就可以了:)
I've got two servers: Web and MySQL, both on Ubuntu 12.04 x64
On Web is setup a phpmyadmin installation and nginx etc. On MySQL is setup a mysqsl installation
When I run mysql --user=user --host=MySQL.hostname --password, from Web, I can connect just fine to the MySQL server
But when I try to connect via phpmyadmin, it does not work. why?
User is not root
In the /usr/share/phpmyadmin/config.inc.php file (which I copied from the sample), I have this:
/*
* First server
*/
$i++;
/* Authentication type */
$cfg['Servers'][$i]['auth_type'] = 'cookie';
/* Server parameters */
$cfg['Servers'][$i]['host'] = 'MySQL.hostname';
$cfg['Servers'][$i]['connect_type'] = 'tcp';
$cfg['Servers'][$i]['compress'] = false;
/* Select mysql if your server does not have mysqli */
$cfg['Servers'][$i]['extension'] = 'mysqli';
$cfg['Servers'][$i]['AllowNoPassword'] = false;
On the MySQL server, I have it setup to bind to 0.0.0.0 and I have user permissions for this user on 'localhost' and '%' (remember- I do connect just fine via mysql client)
(note: MySQL.hostname is actually a resolvable hostname, just using this here for example)
OK the answer is simple, even though the main files reside in /usr/share/phpmyadmin, the config is actually loaded in /etc/phpmyadmin/
Changing config.inc.php there did the trick :)
这篇关于远程phpmyadmin无法登录,但mysql客户端可以登录的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!