dongmufen8105 2015-03-07 20:19
浏览 160

本地连接到phpMyAdmin

I set up phpMyAdmin on the local side. 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. I thought these were the same.

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.

Here is my local host config for the 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. How can I overcome this?

  • 写回答

1条回答 默认 最新

  • dtc4547 2015-03-22 23:33
    关注

    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. You'll use whatever host 1&1 tells you to use in their documentation or settings for accessing MySQL; it may be 'localhost' or may be some other internal database server name.

    Here's the deeper explanation: SFTP and SSH are similar and related but differing protocols. 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; mainly file transfers.

    There are two ways to use phpMyAdmin to connect to your MySQL server; 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.

    Most hosts block external MySQL connections; 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. If you'd have SSH access, you could tunnel your connection and appear to be coming from inside the network because of the tunnel. 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. 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).

    评论

报告相同问题?

悬赏问题

  • ¥15 求解O-S方程的特征值问题给出边界层布拉休斯平行流的中性曲线
  • ¥15 谁有desed数据集呀
  • ¥20 手写数字识别运行c仿真时,程序报错错误代码sim211-100
  • ¥15 关于#hadoop#的问题
  • ¥15 (标签-Python|关键词-socket)
  • ¥15 keil里为什么main.c定义的函数在it.c调用不了
  • ¥50 切换TabTip键盘的输入法
  • ¥15 可否在不同线程中调用封装数据库操作的类
  • ¥15 微带串馈天线阵列每个阵元宽度计算
  • ¥15 keil的map文件中Image component sizes各项意思