简体   繁体   English

本地连接到phpMyAdmin

[英]Local connect to phpMyAdmin

I set up phpMyAdmin on the local side. 我在本地设置了phpMyAdmin。 I am having trouble connecting it to my remote server. 我无法将其连接到我的远程服务器。 I use 1&1 hosting and I found a tutorial about doing exactly what I want, except for the fact that I can only connect using SFTP and the tutorial is using SSH. 我使用1&1托管,并且找到了一个完全按照自己的意愿做事的教程,除了我只能使用SFTP进行连接并且该教程使用SSH的事实。 I thought these were the same. 我以为这些都一样。

http://franklinstrube.com/blog/remote-mysql-administration-for-1and1/ http://franklinstrube.com/blog/remote-mysql-administration-for-1and1/

This tutorial is telling me I need to install socat and do an SSH tunneling, but it is not accepting any commands from this tutorial since I can only us SFTP. 本教程告诉我我需要安装socat并进行SSH隧道传输,但是由于我只能使用SFTP,因此它不接受本教程中的任何命令。

Here is my local host config for the phpMyAdmin 这是我的本地主机配置phpMyAdmin

$cfg['Servers'][$i]['host']          = '';
$cfg['Servers'][$i]['port']          = '';
$cfg['Servers'][$i]['socket']        = '';
$cfg['Servers'][$i]['connect_type']  = 'tcp';
$cfg['Servers'][$i]['extension']     = 'mysql';
$cfg['Servers'][$i]['compress']      = FALSE;
$cfg['Servers'][$i]['auth_type']     = 'config';
$cfg['Servers'][$i]['user']          = 'username';
$cfg['Servers'][$i]['password']      = 'password';

My current problem is the difference in the tutorial between their use of SSH and my ability to only us SFTP. 我当前的问题是在使用SSH和仅使用SFTP的能力之间存在教程差异。 How can I overcome this? 我该如何克服?

How can I overcome this? 我该如何克服?

Simply put, by installing phpMyAdmin on your 1&1 hosted web page (and properly securing it, since it's public-facing!) rather than running phpMyAdmin on your local machine. 简而言之,通过在1&1托管网页上安装phpMyAdmin(并确保其安全性,因为它是面向公众的!),而不是在本地计算机上运行phpMyAdmin。 You'll use whatever host 1&1 tells you to use in their documentation or settings for accessing MySQL; 您将使用主机1&1告诉您的主机或文档中用于访问MySQL的任何内容。 it may be 'localhost' or may be some other internal database server name. 它可能是“ localhost”,也可能是其他一些内部数据库服务器名称。

Here's the deeper explanation: SFTP and SSH are similar and related but differing protocols. 这是更深入的说明:SFTP和SSH相似且相关,但协议不同。 The intricacies of their similarities and differences aren't really important here but SSH was designed to give users a command shell and SFTP is designed for file-level functionality; 它们的复杂性和差异的复杂性在这里并不是很重要,但是SSH旨在为用户提供命令外壳,而SFTP则用于文件级功能。 mainly file transfers. 主要是文件传输。

There are two ways to use phpMyAdmin to connect to your MySQL server; 有两种方法可以使用phpMyAdmin连接到MySQL服务器。 by running it on the same server (connecting via socket or localhost network connection) or by connecting from some other server. 通过在同一服务器上运行它(通过套接字或本地主机网络连接进行连接)或通过其他服务器进行连接。 MySQL permissions can be assigned based on host, so having permission to connect from localhost is not the same as some random external networking connection. 可以基于主机分配MySQL权限,因此具有从localhost连接的权限与某些随机外部网络连接不同。

Most hosts block external MySQL connections; 大多数主机会阻止外部MySQL连接。 this is a great way of providing security because random attackers can't even connect to their MySQL server, but it makes administration a bit less convenient for you. 这是一种提供安全性的好方法,因为随机攻击者甚至无法连接到他们的MySQL服务器,但这会使管理工作变得不那么方便。 If you'd have SSH access, you could tunnel your connection and appear to be coming from inside the network because of the tunnel. 如果您具有SSH访问权限,则可以建立连接隧道,并且由于该隧道而似乎来自网络内部。 Since you don't have SSH access and since SFTP doesn't provide that level of functionality, you're stuck with installing phpMyAdmin on your web site at 1&1 and accessing the web page remotely rather than accessing the MySQL daemon itself. 由于您没有SSH访问权限,并且SFTP不提供该级别的功能,因此您必须坚持在网站1&1上安装phpMyAdmin并远程访问网页,而不是访问MySQL守护程序本身。 Actually, this will probably be faster for you than tunneling your MySQL connection, but you'll want to secure your installation (I suggest at the very least using a non-standard directory name and making sure you have a strong password; you may also wish to use the captcha that's an option with recent phpMyAdmin versions). 实际上,对您而言,这可能比通过MySQL连接建立隧道要快,但是您将希望确保安装的安全(我建议至少使用非标准目录名并确保您具有强密码;您也可以希望使用在最近的phpMyAdmin版本中选择的验证码)。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM