当前位置:Gxlcms > PHP教程 > 179phpphpMyAdmin访问远程数据库

179phpphpMyAdmin访问远程数据库

时间:2021-07-01 10:21:17 帮助过:15人阅读

phpMyAdmin访问远程数据库


编辑config.inc.php

找到config.inc.php,编辑在后面添加

A.访问网址

$cfg['PmaAbsoluteUri'] = '';这里填写phpmyadmin的访问网址 

B.mysql主机信息

$cfg['Servers'][$i]['host'] = 'localhost'; // MySQL hostname or IP address 
填写localhost或mysql所在服务器的ip地址,如果mysql和该phpmyadmin在同一服务器,则按默认localhost 
$cfg['Servers'][$i]['port'] = ''; // MySQL port - leave blank for default port 

mysql端口,如果是默认3306,保留为空即可

C.mysql用户名和密码

$cfg['Servers'][$i]['user'] = 'root'; // MySQL user 访问phpmyadmin使用的mysql用户名 
fg['Servers'][$i]['password'] = ''; // MySQL password (only needed对应上述mysql用户名的密码 

D.认证方法

$cfg['Servers'][\$i]['auth_type'] = 'cookie';
在此有四种模式可供选择,cookie,http,HTTP,config
config方式即输入phpmyadmin的访问网址即可直接进入,无需输入用户名和密码,是不安全的,不推荐使用。
当该项设置为cookie,http或HTTP时,登录phpmyadmin需要数据用户名和密码进行验证,,具体如下:
PHP安装模式为Apache,可以使用http和cookie;
PHP安装模式为CGI,可以使用cookie

E.短语密码(blowfish_secret)的设置

引用:
$cfg['blowfish_secret'] = '';
如果认证方法设置为cookie,就需要设置短语密码,置于设置为什么密码,由您自己决定 ,但是不能留空,否则会在登录phpmyadmin时提示错误

').addClass('pre-numbering').hide(); $(this).addClass('has-numbering').parent().append($numbering); for (i = 1; i <= lines; i++) { $numbering.append($('
  • ').text(i)); }; $numbering.fadeIn(1700); }); });

    以上就介绍了 179 php phpMyAdmin访问远程数据库,包括了方面的内容,希望对PHP教程有兴趣的朋友有所帮助。

  • 人气教程排行