bannerstop/tunneled-mysql 问题修复 & 功能扩展

解决BUG、新增功能、兼容多环境部署,快速响应你的开发需求

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

bannerstop/tunneled-mysql

最新稳定版本:0.0.1

Composer 安装命令:

composer require bannerstop/tunneled-mysql

包简介

Using a MySQL server via an SSH tunnel.

README 文档

README

Using a MySQL server via an SSH tunnel.

Notice

SSH Tunnel does not currently support requesting the SSH password for the private key provided, so make sure your SSH key does not require a password.

If you are not sure whether your SSH key pair requires a passphrase, you can create a new SSH key pair

# generate key pair without passphrase
ssh-keygen -t rsa -b 4096 -f ~/.ssh/id_rsa_no_pass -N ""

# copy public key to remote server
ssh-copy-id -i ~/.ssh/id_rsa_no_pass.pub user@host

Make sure that your PHP application has the authorization to access the private SSH key file

Installation

Use Composer to install:

composer require bannerstop/tunneled-mysql

Usage

$tunnelBuilder = new \Bannerstop\TunneledMysql\TunnelBuilder(
    new \Bannerstop\TunneledMysql\SSH\SSHCredentials(
        'ssh.example.host',
        'user',
        'path/to/private_key'
    ),
    new \Bannerstop\TunneledMysql\MySQL\MySQLCredentials(
        'username',
        'pass',
        'dbname'
    ),
    (new \Bannerstop\TunneledMysql\Lib\GetAvailablePort())->execute()
);
$mysql = $tunnelBuilder->build()->run();

$query = $mysql->query('SELECT * FROM example LIMIT 1');
print_r($query->fetch());

统计信息

  • 总下载量: 89
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 0
  • 点击次数: 4
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 0
  • Watchers: 2
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2024-11-02

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固