vagrant mysql 连接_使用mysql Workbench连接到Vagrant Mysql

我有流浪汉穿过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

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值