简体   繁体   English

TYPO3和MySQL数据库位于不同的服务器上

[英]TYPO3 and MySQL database on separate servers

是否可以在TYPO3通过SSH隧道连接数据库的单独服务器上运行TYPO3(6.0)和MySQL?

This should be possible. 这应该是可能的。 However, it depends how your web hoster manages access from remote servers. 但是,这取决于您的Web主机管理员如何管理远程服务器的访问权限。 For TYPO3 4.x, it's something like that in localconf.php : 对于TYPO3 4.x,它在localconf.php是这样的:

$typo_db_username = 'mysql_user';
$typo_db_password = 'mysql_password';
$typo_db_host = '127.0.0.1:12345';
$typo_db = 'mysql_dbname';

For TYPO3 > 6.x, it's in LocalConfiguration.php : 对于TYPO3> 6.x,它位于LocalConfiguration.php

return array(
  [...]
  'DB' => array(
  'database' => 'mysql_dbname',
  'host' => '127.0.0.1:12345',
  'password' => 'mysql_password',
  'username' => 'mysql_user',
  ),
  [...]
);

Where 12345 is the local port you used to set up the tunnel: 其中12345是您用于设置隧道的本地端口:

ssh -L 12345:127.0.0.1:3306 ssh_user@remoteserver.com

On most servers, you can use localhost instead of 127.0.0.1 . 在大多数服务器上,您可以使用localhost而不是127.0.0.1
IMHO, the security bottleneck is how the remote MySQL server handles incoming connections. 恕我直言,安全瓶颈是远程MySQL服务器如何处理传入连接。 I guess you can also set ths in via the install tool. 我想你也可以通过安装工具设置。

EDIT : Changed the host according to hints from comments. 编辑 :根据评论提示更改主机。

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

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