我有流浪汉穿过Laravel Homestead.如何创建一个Mysql Workbench连接(Workbench在VM之外)到我的vagrant
mysql?我试过了:
SSH上的标准TCP / IP
ssh host: 192.168.10.10 // (same as my Homestead.yaml file)
ssh user: vagrant
ssh password: // (I've tried blank or vagrant)
ssh key file: ~/.ssh/id_rsa
mysql host: 127.0.0.1
mysql port: 3306
user: root
password:
我已经尝试了我能理解的每一种组合.我错过了什么?我有一个高效的web dev enviro已在本地运行.我想尝试流浪的虚拟服务器.我只是错过了与vagrant的mysql的本地连接.我已经在这3天了.
Vagrantfile:
require 'json'
require 'yaml'
VAGRANTFILE_API_VERSION = "2"
homesteadYamlPath = File.expand_path("~/.homestead/Homestead.yaml")
afterScriptPath = File.expand_path("~/.homestead/after.sh")
aliasesPath = File.expand_path("~/.homestead/aliases")
require_relative 'scripts/homestead.rb'
Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|
if File.exists? aliasesPath then
config.vm.provision "file", source: aliasesPath, destination: "~/.bash_aliases"
end
Homestead.configure(config, YAML::load(File.read(homesteadYamlPath)))
if File.exists? afterScriptPath then
config.vm.provision "shell", path: afterScriptPath
end
end
Homestead.yaml:
---
ip: "192.168.10.10"
memory: 2048
cpus: 1
authorize: ~/.ssh/id_rsa.pub
keys:
- ~/.ssh/id_rsa
folders:
- map: ~/projects/
to: /home/vagrant/projects/
sites:
- map: test1.local
to: /home/vagrant/projects/test1
- map: test2.local
to: /home/vagrant/projects/test2
databases:
- homestead
variables:
- key: APP_ENV
value: local
请注意:
为了使工作正常,我选择使用标准TCP / IP而不是标准TCP / IP通过SSH与Mysql Workbench连接.我使用的设置是:
Hostname: localhost
Port: 33060
Username: homestead
Password: secret