$vagrant up
$vagrant ssh-config
Host local
HostName 127.0.0.1
User vagrant
Port 2222
UserKnownHostsFile /dev/null
StrictHostKeyChecking no
PasswordAuthentication no
IdentityFile "C:/virtualM/deb56/puphpet/files/dot/ssh/id_rsa"
IdentityFile "C:/Users/User/.vagrant.d/insecure_private_key"
IdentitiesOnly yes
LogLevel FATAL
2 回答
在SSH / SSL选项卡中,选择
Auth type Key pair
,然后将路径复制到IdentityFile
中定义的私钥文件 . 例如C:/virtualM/deb56/puphpet/files/dot/ssh/id_rsa
这是一篇关于这个主题的非常好的文章:
https://www.theodo.fr/blog/2017/03/how-to-manipulate-the-mysql-database-of-your-vagrant-from-phpstorm/
那是:
在PhpStorm中单击视图 - >工具窗口 - >数据库
单击数据库侧栏,单击新建 - >数据源 - > MySQL将出现配置窗口
打开终端 .
转到您的项目:
cd ~/path/to/your/project
从终端运行
vagrant ssh-config
命令在您正在创建的连接的PhpStorm配置窗口中,转到SSH / SSL选项卡
选择"Use SSH tunnel"并从终端输入数据 . 验证类型应为"Key pair (Open SSH)" .
复制"Host name"至"Proxy host","Port"至"port","User"至"Proxy user"和"Identity file"至"Private key file"
在"General"选项卡中,您应该像在虚拟机上一样输入数据库连接数据(即从项目数据库设置中复制) .
测试你的连接 .
或者只是访问我在顶部发布的URL .